зеркало из https://github.com/microsoft/docker.git
Fix TestGetInfo when there is more than one image in the test repository
See also #1089, #1072.
This commit is contained in:
Родитель
ead9cefadb
Коммит
6dacbb451f
|
@ -112,6 +112,11 @@ func TestGetInfo(t *testing.T) {
|
||||||
|
|
||||||
srv := &Server{runtime: runtime}
|
srv := &Server{runtime: runtime}
|
||||||
|
|
||||||
|
initialImages, err := srv.runtime.graph.All()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
r := httptest.NewRecorder()
|
r := httptest.NewRecorder()
|
||||||
|
|
||||||
if err := getInfo(srv, APIVERSION, r, nil, nil); err != nil {
|
if err := getInfo(srv, APIVERSION, r, nil, nil); err != nil {
|
||||||
|
@ -123,8 +128,8 @@ func TestGetInfo(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
if infos.Images != 1 {
|
if infos.Images != len(initialImages) {
|
||||||
t.Errorf("Excepted images: %d, %d found", 1, infos.Images)
|
t.Errorf("Excepted images: %d, %d found", len(initialImages), infos.Images)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче