Update tests to handle codec changes
This commit is contained in:
@@ -421,7 +421,7 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||
return
|
||||
}
|
||||
if strings.Contains(name, "scheduler-policy-config") {
|
||||
if err := schedulerapilatest.Codec.DecodeInto(data, expectedType); err != nil {
|
||||
if err := runtime.DecodeInto(schedulerapilatest.Codec, data, expectedType); err != nil {
|
||||
t.Errorf("%s did not decode correctly: %v\n%s", path, err, string(data))
|
||||
return
|
||||
}
|
||||
@@ -516,14 +516,14 @@ func TestReadme(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("%s could not be converted to JSON: %v\n%s", path, err, string(content))
|
||||
}
|
||||
if err := testapi.Default.Codec().DecodeInto(json, expectedType); err != nil {
|
||||
if err := runtime.DecodeInto(testapi.Default.Codec(), json, expectedType); err != nil {
|
||||
t.Errorf("%s did not decode correctly: %v\n%s", path, err, string(content))
|
||||
continue
|
||||
}
|
||||
if errors := validateObject(expectedType); len(errors) > 0 {
|
||||
t.Errorf("%s did not validate correctly: %v", path, errors)
|
||||
}
|
||||
_, err = testapi.Default.Codec().Encode(expectedType)
|
||||
_, err = runtime.Encode(testapi.Default.Codec(), expectedType)
|
||||
if err != nil {
|
||||
t.Errorf("Could not encode object: %v", err)
|
||||
continue
|
||||
|
Reference in New Issue
Block a user