Update tests to handle codec changes

This commit is contained in:
Clayton Coleman
2016-01-22 00:06:52 -05:00
parent 2fd38a7dc0
commit 33085c0cf2
34 changed files with 147 additions and 181 deletions

View File

@@ -87,8 +87,7 @@ func TestCreateFromConfig(t *testing.T) {
{"name" : "PriorityOne", "weight" : 2},
{"name" : "PriorityTwo", "weight" : 1} ]
}`)
err := latestschedulerapi.Codec.DecodeInto(configData, &policy)
if err != nil {
if err := runtime.DecodeInto(latestschedulerapi.Codec, configData, &policy); err != nil {
t.Errorf("Invalid configuration: %v", err)
}
@@ -111,8 +110,7 @@ func TestCreateFromEmptyConfig(t *testing.T) {
factory := NewConfigFactory(client, api.DefaultSchedulerName)
configData = []byte(`{}`)
err := latestschedulerapi.Codec.DecodeInto(configData, &policy)
if err != nil {
if err := runtime.DecodeInto(latestschedulerapi.Codec, configData, &policy); err != nil {
t.Errorf("Invalid configuration: %v", err)
}