1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #14314 from sunyuan3/TestRmiBlank

Add the expected error verification for TestRmiBlank.
This commit is contained in:
David Calavera 2015-07-01 09:09:56 -07:00
commit 1d7a62d776

View file

@ -252,4 +252,19 @@ func (s *DockerSuite) TestRmiBlank(c *check.C) {
if strings.Contains(out, "No such image") { if strings.Contains(out, "No such image") {
c.Fatalf("Wrong error message generated: %s", out) 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)
}
} }