mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
fix tests, minor changes in output
This commit is contained in:
parent
feb7360d30
commit
872f8b00cc
2 changed files with 6 additions and 6 deletions
|
|
@ -204,7 +204,7 @@ func (val *v) ValidateResource(res resource.Resource) Result {
|
|||
}
|
||||
validationErrors = append(validationErrors, ValidationError{
|
||||
Path: path,
|
||||
Msg: ve.LocalizedError(message.NewPrinter(language.English)),
|
||||
Msg: ve.ErrorKind.LocalizedString(message.NewPrinter(language.English)),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ lastName: bar
|
|||
[]ValidationError{
|
||||
{
|
||||
Path: "/firstName",
|
||||
Msg: "expected number, but got string",
|
||||
Msg: "got string, want number",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -145,7 +145,7 @@ firstName: foo
|
|||
[]ValidationError{
|
||||
{
|
||||
Path: "",
|
||||
Msg: "missing properties: 'lastName'",
|
||||
Msg: "missing property 'lastName'",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -447,8 +447,8 @@ age: not a number
|
|||
}`)
|
||||
|
||||
expectedErrors := []ValidationError{
|
||||
{Path: "", Msg: "missing properties: 'lastName'"},
|
||||
{Path: "/age", Msg: "expected integer, but got string"},
|
||||
{Path: "", Msg: "missing property 'lastName'"},
|
||||
{Path: "/age", Msg: "got string, want integer"},
|
||||
}
|
||||
|
||||
val := v{
|
||||
|
|
@ -523,7 +523,7 @@ firstName: foo
|
|||
|
||||
expectedStatuses := []Status{Valid, Invalid}
|
||||
expectedValidationErrors := []ValidationError{
|
||||
{Path: "", Msg: "missing properties: 'lastName'"},
|
||||
{Path: "", Msg: "missing property 'lastName'"},
|
||||
}
|
||||
if !reflect.DeepEqual(expectedStatuses, gotStatuses) {
|
||||
t.Errorf("Expected %+v, got %+v", expectedStatuses, gotStatuses)
|
||||
|
|
|
|||
Loading…
Reference in a new issue