Browse Source

Add unit test for #174 Delete image already deleted then repulled

Guillaume J. Charmes 12 years ago
parent
commit
baea0a98f8
1 changed files with 8 additions and 0 deletions
  1. 8 0
      graph_test.go

+ 8 - 0
graph_test.go

@@ -158,6 +158,14 @@ func TestDelete(t *testing.T) {
 	}
 	assertNImages(graph, t, 1)
 
+	// Test delete twice (pull -> rm -> pull -> rm)
+	if err := graph.Register(archive, img1); err != nil {
+		t.Fatal(err)
+	}
+	if err := graph.Delete(img1.Id); err != nil {
+		t.Fatal(err)
+	}
+	assertNImages(graph, t, 1)
 }
 
 func assertNImages(graph *Graph, t *testing.T, n int) {