1
0
mirror of https://github.com/moby/moby.git synced 2025-08-01 05:47:11 +03:00

Stop using deprecated SockRequest

Signed-off-by: Stanislav Bondarenko <stanislav.bondarenko@gmail.com>
This commit is contained in:
Stanislav Bondarenko
2017-05-23 23:56:26 -04:00
parent cdf870bd0b
commit 0fd5a65428
32 changed files with 1399 additions and 1165 deletions

View File

@ -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)