From 6dacbb451f1134ca1c215bd86b74006934468922 Mon Sep 17 00:00:00 2001 From: Louis Opter Date: Mon, 1 Jul 2013 15:06:08 -0700 Subject: [PATCH] Fix TestGetInfo when there is more than one image in the test repository See also #1089, #1072. --- api_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api_test.go b/api_test.go index 864c57d19d..002ee1d54e 100644 --- a/api_test.go +++ b/api_test.go @@ -112,6 +112,11 @@ func TestGetInfo(t *testing.T) { srv := &Server{runtime: runtime} + initialImages, err := srv.runtime.graph.All() + if err != nil { + t.Fatal(err) + } + r := httptest.NewRecorder() if err := getInfo(srv, APIVERSION, r, nil, nil); err != nil { @@ -123,8 +128,8 @@ func TestGetInfo(t *testing.T) { if err != nil { t.Fatal(err) } - if infos.Images != 1 { - t.Errorf("Excepted images: %d, %d found", 1, infos.Images) + if infos.Images != len(initialImages) { + t.Errorf("Excepted images: %d, %d found", len(initialImages), infos.Images) } }