Fix integration tests

This commit is contained in:
derekwaynecarr
2014-10-02 12:56:42 -04:00
parent d5ec260db8
commit 0a290506c2
2 changed files with 8 additions and 6 deletions

View File

@@ -59,6 +59,7 @@ func TestClient(t *testing.T) {
}
for apiVersion, values := range testCases {
ctx := api.NewDefaultContext()
deleteAllEtcdKeys()
s := httptest.NewServer(apiserver.Handle(values.Storage, values.Codec, fmt.Sprintf("/api/%s/", apiVersion), values.selfLinker))
client := client.NewOrDie(&client.Config{Host: s.URL, Version: apiVersion})
@@ -71,7 +72,7 @@ func TestClient(t *testing.T) {
t.Errorf("expected %#v, got %#v", e, a)
}
pods, err := client.ListPods(labels.Everything())
pods, err := client.ListPods(ctx, labels.Everything())
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
@@ -92,14 +93,14 @@ func TestClient(t *testing.T) {
},
},
}
got, err := client.CreatePod(pod)
got, err := client.CreatePod(ctx, pod)
if err == nil {
t.Fatalf("unexpected non-error: %v", err)
}
// get a created pod
pod.DesiredState.Manifest.Containers[0].Image = "an-image"
got, err = client.CreatePod(pod)
got, err = client.CreatePod(ctx, pod)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
@@ -108,7 +109,7 @@ func TestClient(t *testing.T) {
}
// pod is shown, but not scheduled
pods, err = client.ListPods(labels.Everything())
pods, err = client.ListPods(ctx, labels.Everything())
if err != nil {
t.Fatalf("unexpected error: %v", err)
}