...

Source file src/edge-infra.dev/pkg/f8n/warehouse/packagelock/cmd/validate/validate_test.go

Documentation: edge-infra.dev/pkg/f8n/warehouse/packagelock/cmd/validate

     1  package validate
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  )
     7  
     8  func TestValidate(t *testing.T) {
     9  	cmd := New()
    10  	testCases := map[string]bool{
    11  		"testdata/warehouse-lock-pass.yaml": true,
    12  		"testdata/warehouse-lock-fail.yaml": false,
    13  	}
    14  
    15  	for lockPath, shouldPass := range testCases {
    16  		err := cmd.ParseAndRun(context.Background(), []string{lockPath})
    17  		if err != nil && shouldPass {
    18  			t.Errorf("tc should have passed for %s", lockPath)
    19  		}
    20  	}
    21  }
    22  

View as plain text