fix up broken tests

This commit is contained in:
deads2k 2017-01-27 08:15:51 -05:00
parent e6e17a5be6
commit 17fc371dbc
2 changed files with 2 additions and 2 deletions

View File

@ -141,7 +141,7 @@ stuff: 1
t.Fatal("expected error with yaml: violate, got no error") t.Fatal("expected error with yaml: violate, got no error")
} }
fmt.Printf("err: %s\n", err.Error()) fmt.Printf("err: %s\n", err.Error())
if !strings.HasPrefix(err.Error(), "yaml: line 2:") { if !strings.Contains(err.Error(), "yaml: line 2:") {
t.Fatalf("expected %q to have 'yaml: line 2:' found a tab character", err.Error()) t.Fatalf("expected %q to have 'yaml: line 2:' found a tab character", err.Error())
} }
} }

View File

@ -57,7 +57,7 @@ import (
// without applying any validations and/or defaults. It shouldn't be considered a replacement // without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests. // for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset { func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder()) o := testing.NewObjectTracker(api.Registry, api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects { for _, obj := range objects {
if err := o.Add(obj); err != nil { if err := o.Add(obj); err != nil {
panic(err) panic(err)