mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
[test-integration] Migrate some more tests to cli package
Add some required command operators to the `cli` package, and update some tests to use this package, in order to remove a few functions from `docker_utils_test.go` Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/docker/docker/api"
|
||||
"github.com/docker/docker/integration-cli/checker"
|
||||
"github.com/docker/docker/integration-cli/cli"
|
||||
"github.com/docker/docker/integration-cli/request"
|
||||
"github.com/docker/docker/pkg/testutil"
|
||||
icmd "github.com/docker/docker/pkg/testutil/cmd"
|
||||
@@ -71,10 +72,7 @@ func (s *DockerSuite) TestAPIDockerAPIVersion(c *check.C) {
|
||||
defer server.Close()
|
||||
|
||||
// Test using the env var first
|
||||
result := icmd.RunCmd(icmd.Cmd{
|
||||
Command: binaryWithArgs("-H="+server.URL[7:], "version"),
|
||||
Env: appendBaseEnv(false, "DOCKER_API_VERSION=xxx"),
|
||||
})
|
||||
result := cli.Docker(cli.Args("-H="+server.URL[7:], "version"), cli.WithEnvironmentVariables("DOCKER_API_VERSION=xxx"))
|
||||
c.Assert(result, icmd.Matches, icmd.Expected{Out: "API version: xxx", ExitCode: 1})
|
||||
c.Assert(svrVersion, check.Equals, "/vxxx/version", check.Commentf("%s", result.Compare(icmd.Success)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user