コード例 #1
0
ファイル: storage.go プロジェクト: roberto/docker-cluster
func testRetrieveImages(storage cluster.Storage, t *testing.T) {
	defer storage.RemoveImage("img-1", "id1", "host-1.something")
	defer storage.RemoveImage("img-1", "id1", "host-2")
	defer storage.RemoveImage("img-1", "id2", "host-2")
	err := storage.StoreImage("img-1", "id1", "host-1.something")
	assertIsNil(err, t)
	err = storage.StoreImage("img-1", "id1", "host-2")
	assertIsNil(err, t)
	imgs, err := storage.RetrieveImages()
	assertIsNil(err, t)
	if len(imgs) != 2 {
		t.Errorf("Unexpected len %d - expected %d", len(imgs), 2)
	}
}