Change to use c.Assert() instead of result.Assert()

Fix delete containers and make sure it prints errors correctly.
Rename Result.Fails to Result.Assert()
Create a constant for the default expected.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 243885808f5c69143679d094d964d333c47e69bf
Component: engine
This commit is contained in:
Daniel Nephin
2016-08-16 17:51:38 -04:00
parent eaa727c6e2
commit 0d4234bb46
14 changed files with 86 additions and 47 deletions

View File

@ -90,11 +90,11 @@ func (s *DockerSuite) TestApiDockerApiVersion(c *check.C) {
// Test using the env var first
result := icmd.RunCmd(icmd.Cmd{
Command: binaryWithArgs([]string{"-H", server.URL[7:], "version"}),
Env: []string{"DOCKER_API_VERSION=xxx"},
Command: binaryWithArgs("-H="+server.URL[7:], "version"),
Env: appendBaseEnv(false, "DOCKER_API_VERSION=xxx"),
})
result.Assert(c, icmd.Expected{Out: "API version: xxx", ExitCode: 1})
c.Assert(svrVersion, check.Equals, "/vxxx/version")
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)))
}
func (s *DockerSuite) TestApiErrorJSON(c *check.C) {