Update generic etcd tests for cluster-scoped objects

This commit is contained in:
Jordan Liggitt
2015-05-18 23:17:51 -04:00
parent c5da035d51
commit a6401fa433
7 changed files with 146 additions and 66 deletions

View File

@@ -88,9 +88,9 @@ func validChangedNode() *api.Node {
func TestCreate(t *testing.T) {
storage, fakeEtcdClient := newStorage(t)
test := resttest.New(t, storage, fakeEtcdClient.SetError)
test := resttest.New(t, storage, fakeEtcdClient.SetError).ClusterScope()
node := validNewNode()
node.ObjectMeta = api.ObjectMeta{}
node.ObjectMeta = api.ObjectMeta{GenerateName: "foo"}
test.TestCreate(
// valid
node,
@@ -102,9 +102,9 @@ func TestCreate(t *testing.T) {
}
func TestDelete(t *testing.T) {
ctx := api.NewDefaultContext()
ctx := api.NewContext()
storage, fakeEtcdClient := newStorage(t)
test := resttest.New(t, storage, fakeEtcdClient.SetError)
test := resttest.New(t, storage, fakeEtcdClient.SetError).ClusterScope()
node := validChangedNode()
key, _ := storage.KeyFunc(ctx, node.Name)