sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Not\(checker\.IsNil\)#assert.Assert(c, \1 != nil#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_volume_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
| ... | ... |
@@ -215,7 +215,7 @@ func (s *DockerSuite) TestGetContainerStatsRmRunning(c *testing.T) {
|
| 215 | 215 |
|
| 216 | 216 |
// Now remove without `-f` and make sure we are still pulling stats |
| 217 | 217 |
_, _, err = dockerCmdWithError("rm", id)
|
| 218 |
- assert.Assert(c, err, checker.Not(checker.IsNil), check.Commentf("rm should have failed but didn't"))
|
|
| 218 |
+ assert.Assert(c, err != nil, check.Commentf("rm should have failed but didn't"))
|
|
| 219 | 219 |
_, err = buf.ReadTimeout(b, 2*time.Second) |
| 220 | 220 |
assert.NilError(c, err) |
| 221 | 221 |
|
| ... | ... |
@@ -324,11 +324,11 @@ func (s *DockerSuite) TestInspectTemplateError(c *testing.T) {
|
| 324 | 324 |
runSleepingContainer(c, "--name=container1", "-d") |
| 325 | 325 |
|
| 326 | 326 |
out, _, err := dockerCmdWithError("inspect", "--type=container", "--format='Format container: {{.ThisDoesNotExist}}'", "container1")
|
| 327 |
- assert.Assert(c, err, checker.Not(checker.IsNil)) |
|
| 327 |
+ assert.Assert(c, err != nil) |
|
| 328 | 328 |
assert.Assert(c, out, checker.Contains, "Template parsing error") |
| 329 | 329 |
|
| 330 | 330 |
out, _, err = dockerCmdWithError("inspect", "--type=image", "--format='Format container: {{.ThisDoesNotExist}}'", "busybox")
|
| 331 |
- assert.Assert(c, err, checker.Not(checker.IsNil)) |
|
| 331 |
+ assert.Assert(c, err != nil) |
|
| 332 | 332 |
assert.Assert(c, out, checker.Contains, "Template parsing error") |
| 333 | 333 |
} |
| 334 | 334 |
|
| ... | ... |
@@ -356,7 +356,7 @@ func (s *DockerSuite) TestInspectStopWhenNotFound(c *testing.T) {
|
| 356 | 356 |
runSleepingContainer(c, "--name=busybox2", "-d") |
| 357 | 357 |
result := dockerCmdWithResult("inspect", "--type=container", "--format='{{.Name}}'", "busybox1", "busybox2", "missing")
|
| 358 | 358 |
|
| 359 |
- assert.Assert(c, result.Error, checker.Not(checker.IsNil)) |
|
| 359 |
+ assert.Assert(c, result.Error != nil) |
|
| 360 | 360 |
assert.Assert(c, result.Stdout(), checker.Contains, "busybox1") |
| 361 | 361 |
assert.Assert(c, result.Stdout(), checker.Contains, "busybox2") |
| 362 | 362 |
assert.Assert(c, result.Stderr(), checker.Contains, "Error: No such container: missing") |
| ... | ... |
@@ -364,7 +364,7 @@ func (s *DockerSuite) TestInspectStopWhenNotFound(c *testing.T) {
|
| 364 | 364 |
// test inspect would not fast fail |
| 365 | 365 |
result = dockerCmdWithResult("inspect", "--type=container", "--format='{{.Name}}'", "missing", "busybox1", "busybox2")
|
| 366 | 366 |
|
| 367 |
- assert.Assert(c, result.Error, checker.Not(checker.IsNil)) |
|
| 367 |
+ assert.Assert(c, result.Error != nil) |
|
| 368 | 368 |
assert.Assert(c, result.Stdout(), checker.Contains, "busybox1") |
| 369 | 369 |
assert.Assert(c, result.Stdout(), checker.Contains, "busybox2") |
| 370 | 370 |
assert.Assert(c, result.Stderr(), checker.Contains, "Error: No such container: missing") |
| ... | ... |
@@ -88,7 +88,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSimple(c *testing.T) {
|
| 88 | 88 |
assert.Equal(c, len(refs), 1) |
| 89 | 89 |
|
| 90 | 90 |
assert.Assert(c, refs[0].SecretName, checker.Equals, testName) |
| 91 |
- assert.Assert(c, refs[0].File, checker.Not(checker.IsNil)) |
|
| 91 |
+ assert.Assert(c, refs[0].File != nil) |
|
| 92 | 92 |
assert.Assert(c, refs[0].File.Name, checker.Equals, testName) |
| 93 | 93 |
assert.Assert(c, refs[0].File.UID, checker.Equals, "0") |
| 94 | 94 |
assert.Assert(c, refs[0].File.GID, checker.Equals, "0") |
| ... | ... |
@@ -236,7 +236,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSimple(c *testing.T) {
|
| 236 | 236 |
assert.Equal(c, len(refs), 1) |
| 237 | 237 |
|
| 238 | 238 |
assert.Assert(c, refs[0].ConfigName, checker.Equals, testName) |
| 239 |
- assert.Assert(c, refs[0].File, checker.Not(checker.IsNil)) |
|
| 239 |
+ assert.Assert(c, refs[0].File != nil) |
|
| 240 | 240 |
assert.Assert(c, refs[0].File.Name, checker.Equals, testName) |
| 241 | 241 |
assert.Assert(c, refs[0].File.UID, checker.Equals, "0") |
| 242 | 242 |
assert.Assert(c, refs[0].File.GID, checker.Equals, "0") |
| ... | ... |
@@ -37,7 +37,7 @@ func (s *DockerSuite) TestVolumeCLICreate(c *testing.T) {
|
| 37 | 37 |
} |
| 38 | 38 |
|
| 39 | 39 |
func (s *DockerSuite) TestVolumeCLIInspect(c *testing.T) {
|
| 40 |
- assert.Assert(c, exec.Command(dockerBinary, "volume", "inspect", "doesnotexist").Run(), checker.Not(checker.IsNil), check.Commentf("volume inspect should error on non-existent volume"))
|
|
| 40 |
+ assert.Assert(c, exec.Command(dockerBinary, "volume", "inspect", "doesnotexist").Run() != nil, check.Commentf("volume inspect should error on non-existent volume"))
|
|
| 41 | 41 |
out, _ := dockerCmd(c, "volume", "create") |
| 42 | 42 |
name := strings.TrimSpace(out) |
| 43 | 43 |
out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Name }}", name)
|
| ... | ... |
@@ -210,7 +210,7 @@ func (s *DockerSuite) TestVolumeCLIRm(c *testing.T) {
|
| 210 | 210 |
dockerCmd(c, "rm", "test2") |
| 211 | 211 |
|
| 212 | 212 |
dockerCmd(c, "volume", "rm", volumeID) |
| 213 |
- assert.Assert(c, exec.Command("volume", "rm", "doesnotexist").Run(), checker.Not(checker.IsNil), check.Commentf("volume rm should fail with non-existent volume"))
|
|
| 213 |
+ assert.Assert(c, exec.Command("volume", "rm", "doesnotexist").Run() != nil, check.Commentf("volume rm should fail with non-existent volume"))
|
|
| 214 | 214 |
} |
| 215 | 215 |
|
| 216 | 216 |
// FIXME(vdemeester) should be a unit test in cli/command/volume package |