mirror of
https://github.com/moby/moby.git
synced 2025-07-29 07:21:35 +03:00
rm-gocheck: IsNil
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.IsNil\b#assert.Assert(c, \1 == nil#g' \ -- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_attach_test.go" "integration-cli/docker_cli_attach_unix_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_cp_from_container_test.go" "integration-cli/docker_cli_cp_to_container_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_health_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_import_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_links_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_userns_test.go" "integration-cli/docker_cli_volume_test.go" "integration-cli/docker_hub_pull_suite_test.go" "integration-cli/docker_utils_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/memory/memory_test.go" Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
@ -37,7 +37,7 @@ func (s *DockerSuite) TestCreateArgs(c *testing.T) {
|
||||
}
|
||||
|
||||
err := json.Unmarshal([]byte(out), &containers)
|
||||
assert.Assert(c, err, checker.IsNil, check.Commentf("Error inspecting the container: %s", err))
|
||||
assert.Assert(c, err == nil, check.Commentf("Error inspecting the container: %s", err))
|
||||
assert.Equal(c, len(containers), 1)
|
||||
|
||||
cont := containers[0]
|
||||
@ -96,7 +96,7 @@ func (s *DockerSuite) TestCreateHostConfig(c *testing.T) {
|
||||
}
|
||||
|
||||
err := json.Unmarshal([]byte(out), &containers)
|
||||
assert.Assert(c, err, checker.IsNil, check.Commentf("Error inspecting the container: %s", err))
|
||||
assert.Assert(c, err == nil, check.Commentf("Error inspecting the container: %s", err))
|
||||
assert.Equal(c, len(containers), 1)
|
||||
|
||||
cont := containers[0]
|
||||
@ -117,7 +117,7 @@ func (s *DockerSuite) TestCreateWithPortRange(c *testing.T) {
|
||||
}
|
||||
}
|
||||
err := json.Unmarshal([]byte(out), &containers)
|
||||
assert.Assert(c, err, checker.IsNil, check.Commentf("Error inspecting the container: %s", err))
|
||||
assert.Assert(c, err == nil, check.Commentf("Error inspecting the container: %s", err))
|
||||
assert.Equal(c, len(containers), 1)
|
||||
|
||||
cont := containers[0]
|
||||
@ -147,7 +147,7 @@ func (s *DockerSuite) TestCreateWithLargePortRange(c *testing.T) {
|
||||
}
|
||||
|
||||
err := json.Unmarshal([]byte(out), &containers)
|
||||
assert.Assert(c, err, checker.IsNil, check.Commentf("Error inspecting the container: %s", err))
|
||||
assert.Assert(c, err == nil, check.Commentf("Error inspecting the container: %s", err))
|
||||
assert.Equal(c, len(containers), 1)
|
||||
|
||||
cont := containers[0]
|
||||
@ -179,7 +179,7 @@ func (s *DockerSuite) TestCreateVolumesCreated(c *testing.T) {
|
||||
dockerCmd(c, "create", "--name", name, "-v", prefix+slash+"foo", "busybox")
|
||||
|
||||
dir, err := inspectMountSourceField(name, prefix+slash+"foo")
|
||||
assert.Assert(c, err, checker.IsNil, check.Commentf("Error getting volume host path: %q", err))
|
||||
assert.Assert(c, err == nil, check.Commentf("Error getting volume host path: %q", err))
|
||||
|
||||
if _, err := os.Stat(dir); err != nil && os.IsNotExist(err) {
|
||||
c.Fatalf("Volume was not created")
|
||||
|
Reference in New Issue
Block a user