mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-21 02:47:01 +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{
|
validationErrors = append(validationErrors, ValidationError{
|
||||||
Path: path,
|
Path: path,
|
||||||
Msg: ve.LocalizedError(message.NewPrinter(language.English)),
|
Msg: ve.ErrorKind.LocalizedString(message.NewPrinter(language.English)),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ lastName: bar
|
||||||
[]ValidationError{
|
[]ValidationError{
|
||||||
{
|
{
|
||||||
Path: "/firstName",
|
Path: "/firstName",
|
||||||
Msg: "expected number, but got string",
|
Msg: "got string, want number",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -145,7 +145,7 @@ firstName: foo
|
||||||
[]ValidationError{
|
[]ValidationError{
|
||||||
{
|
{
|
||||||
Path: "",
|
Path: "",
|
||||||
Msg: "missing properties: 'lastName'",
|
Msg: "missing property 'lastName'",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -447,8 +447,8 @@ age: not a number
|
||||||
}`)
|
}`)
|
||||||
|
|
||||||
expectedErrors := []ValidationError{
|
expectedErrors := []ValidationError{
|
||||||
{Path: "", Msg: "missing properties: 'lastName'"},
|
{Path: "", Msg: "missing property 'lastName'"},
|
||||||
{Path: "/age", Msg: "expected integer, but got string"},
|
{Path: "/age", Msg: "got string, want integer"},
|
||||||
}
|
}
|
||||||
|
|
||||||
val := v{
|
val := v{
|
||||||
|
|
@ -523,7 +523,7 @@ firstName: foo
|
||||||
|
|
||||||
expectedStatuses := []Status{Valid, Invalid}
|
expectedStatuses := []Status{Valid, Invalid}
|
||||||
expectedValidationErrors := []ValidationError{
|
expectedValidationErrors := []ValidationError{
|
||||||
{Path: "", Msg: "missing properties: 'lastName'"},
|
{Path: "", Msg: "missing property 'lastName'"},
|
||||||
}
|
}
|
||||||
if !reflect.DeepEqual(expectedStatuses, gotStatuses) {
|
if !reflect.DeepEqual(expectedStatuses, gotStatuses) {
|
||||||
t.Errorf("Expected %+v, got %+v", expectedStatuses, gotStatuses)
|
t.Errorf("Expected %+v, got %+v", expectedStatuses, gotStatuses)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue