package policy import ( "testing" "github.com/go-git/go-billy/v5" ) func TestLoad(t *testing.T) { tests := []struct { name string fs billy.Filesystem resourcePath string paths []string wantErr bool }{{ name: "cpol-limit-configmap-for-sa", fs: nil, resourcePath: "", paths: []string{"../_testdata/policies/cpol-limit-configmap-for-sa.yaml"}, wantErr: false, }, { name: "invalid-schema", fs: nil, resourcePath: "", paths: []string{"../_testdata/policies/invalid-schema.yaml"}, wantErr: true, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { _, _, err := Load(tt.fs, tt.resourcePath, tt.paths...) if (err != nil) != tt.wantErr { t.Errorf("Load() error = %v, wantErr %v", err, tt.wantErr) return } }) } }