diff options
author | Stanislav Bondarenko <stanislav.bondarenko@gmail.com> | 2017-05-23 23:56:26 -0400 |
---|---|---|
committer | Stanislav Bondarenko <stanislav.bondarenko@gmail.com> | 2017-08-23 17:10:04 -0400 |
commit | 0fd5a654280ef509a6512f84981f28d559869b90 (patch) | |
tree | 0e2cfb768f184d90f129564fc79d420b72e2919f /integration-cli/docker_api_attach_test.go | |
parent | cdf870bd0b5fa678b10ef2708cca7ad776b4913c (diff) | |
download | docker-0fd5a654280ef509a6512f84981f28d559869b90.tar.gz |
Stop using deprecated SockRequest
Signed-off-by: Stanislav Bondarenko <stanislav.bondarenko@gmail.com>
Diffstat (limited to 'integration-cli/docker_api_attach_test.go')
-rw-r--r-- | integration-cli/docker_api_attach_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/integration-cli/docker_api_attach_test.go b/integration-cli/docker_api_attach_test.go index 20829335a1..a3aa40f6a4 100644 --- a/integration-cli/docker_api_attach_test.go +++ b/integration-cli/docker_api_attach_test.go @@ -86,11 +86,13 @@ func (s *DockerSuite) TestPostContainersAttachContainerNotFound(c *check.C) { } func (s *DockerSuite) TestGetContainersWsAttachContainerNotFound(c *check.C) { - status, body, err := request.SockRequest("GET", "/containers/doesnotexist/attach/ws", nil, daemonHost()) - c.Assert(status, checker.Equals, http.StatusNotFound) + res, body, err := request.Get("/containers/doesnotexist/attach/ws") + c.Assert(res.StatusCode, checker.Equals, http.StatusNotFound) + c.Assert(err, checker.IsNil) + b, err := request.ReadBody(body) c.Assert(err, checker.IsNil) expected := "No such container: doesnotexist" - c.Assert(getErrorMessage(c, body), checker.Contains, expected) + c.Assert(getErrorMessage(c, b), checker.Contains, expected) } func (s *DockerSuite) TestPostContainersAttach(c *check.C) { @@ -177,6 +179,7 @@ func (s *DockerSuite) TestPostContainersAttach(c *check.C) { // Make sure we don't see "hello" if Logs is false client, err := client.NewEnvClient() c.Assert(err, checker.IsNil) + defer client.Close() cid, _ = dockerCmd(c, "run", "-di", "busybox", "/bin/sh", "-c", "echo hello; cat") cid = strings.TrimSpace(cid) |