Merge pull request #12293 from deads2k/testclient-specific-reaction

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot
2015-09-02 09:18:24 -07:00
33 changed files with 270 additions and 149 deletions

View File

@@ -30,8 +30,7 @@ import (
)
func TestRunStop(t *testing.T) {
o := testclient.NewObjects(api.Scheme, api.Scheme)
client := &testclient.Fake{ReactFn: testclient.ObjectReaction(o, api.RESTMapper)}
client := &testclient.Fake{}
binder := NewPersistentVolumeClaimBinder(client, 1*time.Second)
if len(binder.stopChannels) != 0 {
@@ -118,7 +117,8 @@ func TestExampleObjects(t *testing.T) {
t.Fatal(err)
}
client := &testclient.Fake{ReactFn: testclient.ObjectReaction(o, api.RESTMapper)}
client := &testclient.Fake{}
client.AddReactor("*", "*", testclient.ObjectReaction(o, api.RESTMapper))
if reflect.TypeOf(scenario.expected) == reflect.TypeOf(&api.PersistentVolumeClaim{}) {
pvc, err := client.PersistentVolumeClaims("ns").Get("doesntmatter")
@@ -178,7 +178,8 @@ func TestBindingWithExamples(t *testing.T) {
t.Fatal(err)
}
client := &testclient.Fake{ReactFn: testclient.ObjectReaction(o, api.RESTMapper)}
client := &testclient.Fake{}
client.AddReactor("*", "*", testclient.ObjectReaction(o, api.RESTMapper))
pv, err := client.PersistentVolumes().Get("any")
pv.Spec.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimRecycle
@@ -281,7 +282,8 @@ func TestMissingFromIndex(t *testing.T) {
t.Fatal(err)
}
client := &testclient.Fake{ReactFn: testclient.ObjectReaction(o, api.RESTMapper)}
client := &testclient.Fake{}
client.AddReactor("*", "*", testclient.ObjectReaction(o, api.RESTMapper))
pv, err := client.PersistentVolumes().Get("any")
if err != nil {