update testclient for delegating reaction chain

This commit is contained in:
deads2k
2015-08-03 13:30:35 -04:00
parent 5c2c42eed8
commit 7e180c258d
33 changed files with 270 additions and 149 deletions

View File

@@ -31,7 +31,8 @@ func TestNewClient(t *testing.T) {
if err := AddObjectsFromPath("../../../../examples/guestbook/frontend-service.yaml", o, api.Scheme); err != nil {
t.Fatal(err)
}
client := &Fake{ReactFn: ObjectReaction(o, latest.RESTMapper)}
client := &Fake{}
client.AddReactor("*", "*", ObjectReaction(o, latest.RESTMapper))
list, err := client.Services("test").List(labels.Everything())
if err != nil {
t.Fatal(err)
@@ -61,7 +62,8 @@ func TestErrors(t *testing.T) {
&(errors.NewForbidden("ServiceList", "", nil).(*errors.StatusError).ErrStatus),
},
})
client := &Fake{ReactFn: ObjectReaction(o, latest.RESTMapper)}
client := &Fake{}
client.AddReactor("*", "*", ObjectReaction(o, latest.RESTMapper))
_, err := client.Services("test").List(labels.Everything())
if !errors.IsNotFound(err) {
t.Fatalf("unexpected error: %v", err)