Ensure body is closed after error is checked

Signed-off-by: Antonio Murdaca <runcom@linux.com>
This commit is contained in:
Antonio Murdaca
2015-07-23 14:34:38 +02:00
parent d593130fda
commit 18faf6f94e
6 changed files with 28 additions and 15 deletions
+1 -1
View File
@@ -17,8 +17,8 @@ func (s *DockerSuite) TestExecApiCreateNoCmd(c *check.C) {
dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
status, body, err := sockRequest("POST", fmt.Sprintf("/containers/%s/exec", name), map[string]interface{}{"Cmd": nil})
c.Assert(status, check.Equals, http.StatusInternalServerError)
c.Assert(err, check.IsNil)
c.Assert(status, check.Equals, http.StatusInternalServerError)
if !bytes.Contains(body, []byte("No exec command specified")) {
c.Fatalf("Expected message when creating exec command with no Cmd specified")