mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
update testclient for delegating reaction chain
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user