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

@ -479,7 +479,7 @@ func (s *DockerSuite) TestDockerNetworkInspectWithID(c *check.C) {
func (s *DockerSuite) TestDockerInspectMultipleNetwork(c *check.C) {
result := dockerCmdWithResult("network", "inspect", "host", "none")
result.Assert(c, icmd.Expected{})
c.Assert(result, icmd.Matches, icmd.Success)
networkResources := []types.NetworkResource{}
err := json.Unmarshal([]byte(result.Stdout()), &networkResources)
@ -488,7 +488,7 @@ func (s *DockerSuite) TestDockerInspectMultipleNetwork(c *check.C) {
// Should print an error, return an exitCode 1 *but* should print the host network
result = dockerCmdWithResult("network", "inspect", "host", "nonexistent")
result.Assert(c, icmd.Expected{
c.Assert(result, icmd.Matches, icmd.Expected{
ExitCode: 1,
Err: "Error: No such network: nonexistent",
Out: "host",
@ -500,7 +500,7 @@ func (s *DockerSuite) TestDockerInspectMultipleNetwork(c *check.C) {
// Should print an error and return an exitCode, nothing else
result = dockerCmdWithResult("network", "inspect", "nonexistent")
result.Assert(c, icmd.Expected{
c.Assert(result, icmd.Matches, icmd.Expected{
ExitCode: 1,
Err: "Error: No such network: nonexistent",
Out: "[]",