diff options
author | Vincent Demeester <vincent@sbr.pm> | 2016-12-30 10:49:36 +0100 |
---|---|---|
committer | Vincent Demeester <vincent@sbr.pm> | 2017-01-03 11:49:30 +0100 |
commit | d69d4799a312dfcae63442e290ae6667afd1a038 (patch) | |
tree | 74d4951b19ec0e7a36c44c7d12238fac0d0d13d5 /integration-cli/docker_deprecated_api_v124_unix_test.go | |
parent | de709ebfd891ca44db35353f800d674a8e09a18e (diff) | |
download | docker-d69d4799a312dfcae63442e290ae6667afd1a038.tar.gz |
Add a new request package in integration-cli
The goal is to remove function from `docker_utils.go` and setup
simple, one-responsability package that can be well tested ; and to
ease writing request.
This moves all the calls to `sockRequest` (and similar methods) to
their counterpart in the `request` package.
This introduce `request.Do` to write easier request (with functional
argument to easily augment the request) with some pre-defined function
for the most used http method (i.e. `request.Get`, `request.Post` and
`request.Delete`).
Few of the `sockRequest` call have been moved to `request.Do` (and
`Get`, etc.) to showcase the usage of the package. There is still a
whole lot to do.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat (limited to 'integration-cli/docker_deprecated_api_v124_unix_test.go')
-rw-r--r-- | integration-cli/docker_deprecated_api_v124_unix_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/integration-cli/docker_deprecated_api_v124_unix_test.go b/integration-cli/docker_deprecated_api_v124_unix_test.go index d50a521a94..5fc6c2ddfc 100644 --- a/integration-cli/docker_deprecated_api_v124_unix_test.go +++ b/integration-cli/docker_deprecated_api_v124_unix_test.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/docker/docker/integration-cli/checker" + "github.com/docker/docker/integration-cli/request" "github.com/go-check/check" ) @@ -21,7 +22,7 @@ func (s *DockerNetworkSuite) TestDeprecatedDockerNetworkStartAPIWithHostconfig(c "NetworkMode": netName, }, } - _, _, err := sockRequest("POST", formatV123StartAPIURL("/containers/"+conName+"/start"), config) + _, _, err := request.SockRequest("POST", formatV123StartAPIURL("/containers/"+conName+"/start"), config, daemonHost()) c.Assert(err, checker.IsNil) c.Assert(waitRun(conName), checker.IsNil) networks := inspectField(c, conName, "NetworkSettings.Networks") |