Documentation ¶
Index ¶
- func AddSchemasToStore(t *testing.T, dir string, ms storage.MutableStore)
- func DataFS() fs.FS
- func ExtractTxtArchiveToDir(t *testing.T, path, out string)
- func ExtractTxtArchiveToFS(t *testing.T, path string) fs.FS
- func FilterPolicies[P *policyv1.Policy | policy.Wrapper](t *testing.T, policies []P, params storage.ListPolicyIDsParams) []P
- func FindPolicyFiles(t *testing.T, dir string, callback func(string) error) error
- func LoadPolicy(t *testing.T, path string) *policyv1.Policy
- func PathToDir(tb testing.TB, dir string) string
- func ReadSchemaFromFS(t *testing.T, fsys fs.FS, path string) []byte
- func ReadSchemaFromFile(t *testing.T, path string) []byte
- func RenderTemplate(tb testing.TB, path string, data any) []byte
- func SkipIfGHActions(t *testing.T)
- func TemplateFuncs() template.FuncMap
- func WriteGoldenFile(t *testing.T, path string, contents proto.Message)
- type Case
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSchemasToStore ¶ added in v0.11.0
func AddSchemasToStore(t *testing.T, dir string, ms storage.MutableStore)
func ExtractTxtArchiveToDir ¶ added in v0.30.0
func ExtractTxtArchiveToFS ¶ added in v0.30.0
func FilterPolicies ¶ added in v0.29.0
func FindPolicyFiles ¶ added in v0.11.0
func ReadSchemaFromFS ¶ added in v0.11.0
func ReadSchemaFromFile ¶ added in v0.11.0
func RenderTemplate ¶ added in v0.12.0
func SkipIfGHActions ¶ added in v0.11.0
func TemplateFuncs ¶
Types ¶
type Case ¶ added in v0.11.0
func LoadTestCases ¶ added in v0.11.0
LoadTestCases loads groups of test files from the given path. Consider a directory containing the following set of files: |- test01.yaml |- test01.yaml.err |- test01.yaml.out
The above files will be converted to a Case object as follows:
Case { Name: "test01", Input: <contents_of_test01.yaml>, Want: map[string][]byte{ "err": <contents_of_test01.yaml.err>, "out": <contents_of_test01.yaml.out>, } }.
Click to show internal directories.
Click to hide internal directories.