瀏覽代碼

Add the expected error verification for TestRmiBlank.

Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Yuan Sun 10 年之前
父節點
當前提交
2179dd00dd
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. 15 0
      integration-cli/docker_cli_rmi_test.go

+ 15 - 0
integration-cli/docker_cli_rmi_test.go

@@ -252,4 +252,19 @@ func (s *DockerSuite) TestRmiBlank(c *check.C) {
 	if strings.Contains(out, "No such image") {
 		c.Fatalf("Wrong error message generated: %s", out)
 	}
+
+	if !strings.Contains(out, "Image name can not be blank") {
+		c.Fatalf("Expected error message not generated: %s", out)
+	}
+
+	runCmd = exec.Command(dockerBinary, "rmi", " ")
+	out, _, err = runCommandWithOutput(runCmd)
+
+	if err == nil {
+		c.Fatal("Should have failed to delete '' image")
+	}
+
+	if !strings.Contains(out, "No such image") {
+		c.Fatalf("Expected error message not generated: %s", out)
+	}
 }