MCPcopy
hub / github.com/instrumenta/kubeval / TestValidateInvalidInputs

Function TestValidateInvalidInputs

kubeval/kubeval_test.go:79–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestValidateInvalidInputs(t *testing.T) {
80 var tests = []string{
81 "missing_kind.yaml",
82 "missing_kind_value.yaml",
83 "duplicates.yaml",
84 "duplicates-non-namespaced.yaml",
85 "duplicates-with-namespace.yaml",
86 }
87 for _, test := range tests {
88 filePath, _ := filepath.Abs("../fixtures/" + test)
89 fileContents, _ := ioutil.ReadFile(filePath)
90 config := NewDefaultConfig()
91 config.DefaultNamespace = "the-default-namespace"
92 config.FileName = test
93 _, err := Validate(fileContents, config)
94 if err == nil {
95 t.Errorf("Validate should not pass when testing invalid configuration in " + test)
96 }
97 }
98}
99
100func TestValidateSourceExtraction(t *testing.T) {
101 expectedFileNames := []string{

Callers

nothing calls this directly

Calls 2

NewDefaultConfigFunction · 0.85
ValidateFunction · 0.85

Tested by

no test coverage detected