fix variable shadowing bug in etcd_tools.go

This commit is contained in:
Mike Danese
2015-03-05 21:53:27 -08:00
parent 54b2b47caa
commit 438052c453
3 changed files with 20 additions and 5 deletions

View File

@@ -414,6 +414,17 @@ func TestSetObj(t *testing.T) {
}
}
func TestSetObjFailCAS(t *testing.T) {
obj := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"}}
fakeClient := NewFakeEtcdClient(t)
fakeClient.CasErr = fakeClient.NewError(123)
helper := EtcdHelper{fakeClient, testapi.Codec(), versioner}
err := helper.SetObj("/some/key", obj, nil, 5)
if err == nil {
t.Errorf("Expecting error.")
}
}
func TestSetObjWithVersion(t *testing.T) {
obj := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"}}
fakeClient := NewFakeEtcdClient(t)