diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2019-09-11 12:57:29 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2019-09-11 16:18:04 +0200 |
commit | 0fabf3e41ec3cc0ba5479ce91e278c1e7855eebd (patch) | |
tree | 2a121af1083e89fcfad21b6cbbf8a4f6a5fa03dd /integration-cli/docker_cli_inspect_test.go | |
parent | 09226c4442716b4f057c0260fd86dda078d433ed (diff) | |
download | docker-0fabf3e41ec3cc0ba5479ce91e278c1e7855eebd.tar.gz |
integration-cli: remove unneeded fmt.Sprintf() in asserts
Replaced using a bit of grep-ing;
```
find . -name "*_test.go" -exec sed -E -i 's#assert.Assert\((.*), fmt.Sprintf\((.*)\)\)$#assert.Assert\(\1, \2\)#g' '{}' \;
```
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'integration-cli/docker_cli_inspect_test.go')
-rw-r--r-- | integration-cli/docker_cli_inspect_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go index 7b746f9ee2..be804394eb 100644 --- a/integration-cli/docker_cli_inspect_test.go +++ b/integration-cli/docker_cli_inspect_test.go @@ -118,7 +118,7 @@ func (s *DockerSuite) TestInspectTypeFlagWithInvalidValue(c *testing.T) { dockerCmd(c, "run", "--name=busybox", "-d", "busybox", "true") out, exitCode, err := dockerCmdWithError("inspect", "--type=foobar", "busybox") - assert.Assert(c, err != nil, fmt.Sprintf("%d", exitCode)) + assert.Assert(c, err != nil, "%d", exitCode) assert.Equal(c, exitCode, 1, fmt.Sprintf("%s", err)) assert.Assert(c, strings.Contains(out, "not a valid value for --type")) } @@ -129,7 +129,7 @@ func (s *DockerSuite) TestInspectImageFilterInt(c *testing.T) { out := inspectField(c, imageTest, "Size") size, err := strconv.Atoi(out) - assert.Assert(c, err == nil, fmt.Sprintf("failed to inspect size of the image: %s, %v", out, err)) + assert.Assert(c, err == nil, "failed to inspect size of the image: %s, %v", out, err) //now see if the size turns out to be the same formatStr := fmt.Sprintf("--format={{eq .Size %d}}", size) @@ -151,7 +151,7 @@ func (s *DockerSuite) TestInspectContainerFilterInt(c *testing.T) { out = inspectField(c, id, "State.ExitCode") exitCode, err := strconv.Atoi(out) - assert.Assert(c, err == nil, fmt.Sprintf("failed to inspect exitcode of the container: %s, %v", out, err)) + assert.Assert(c, err == nil, "failed to inspect exitcode of the container: %s, %v", out, err) //now get the exit code to verify formatStr := fmt.Sprintf("--format={{eq .State.ExitCode %d}}", exitCode) @@ -171,12 +171,12 @@ func (s *DockerSuite) TestInspectImageGraphDriver(c *testing.T) { deviceID := inspectField(c, imageTest, "GraphDriver.Data.DeviceId") _, err := strconv.Atoi(deviceID) - assert.Assert(c, err == nil, fmt.Sprintf("failed to inspect DeviceId of the image: %s, %v", deviceID, err)) + assert.Assert(c, err == nil, "failed to inspect DeviceId of the image: %s, %v", deviceID, err) deviceSize := inspectField(c, imageTest, "GraphDriver.Data.DeviceSize") _, err = strconv.ParseUint(deviceSize, 10, 64) - assert.Assert(c, err == nil, fmt.Sprintf("failed to inspect DeviceSize of the image: %s, %v", deviceSize, err)) + assert.Assert(c, err == nil, "failed to inspect DeviceSize of the image: %s, %v", deviceSize, err) } func (s *DockerSuite) TestInspectContainerGraphDriver(c *testing.T) { @@ -196,12 +196,12 @@ func (s *DockerSuite) TestInspectContainerGraphDriver(c *testing.T) { assert.Assert(c, imageDeviceID != deviceID) _, err := strconv.Atoi(deviceID) - assert.Assert(c, err == nil, fmt.Sprintf("failed to inspect DeviceId of the image: %s, %v", deviceID, err)) + assert.Assert(c, err == nil, "failed to inspect DeviceId of the image: %s, %v", deviceID, err) deviceSize := inspectField(c, out, "GraphDriver.Data.DeviceSize") _, err = strconv.ParseUint(deviceSize, 10, 64) - assert.Assert(c, err == nil, fmt.Sprintf("failed to inspect DeviceSize of the image: %s, %v", deviceSize, err)) + assert.Assert(c, err == nil, "failed to inspect DeviceSize of the image: %s, %v", deviceSize, err) } func (s *DockerSuite) TestInspectBindMountPoint(c *testing.T) { @@ -288,7 +288,7 @@ func (s *DockerSuite) TestInspectLogConfigNoType(c *testing.T) { out := inspectFieldJSON(c, "test", "HostConfig.LogConfig") err := json.NewDecoder(strings.NewReader(out)).Decode(&logConfig) - assert.Assert(c, err == nil, fmt.Sprintf("%v", out)) + assert.Assert(c, err == nil, "%v", out) assert.Equal(c, logConfig.Type, "json-file") assert.Equal(c, logConfig.Config["max-file"], "42", fmt.Sprintf("%v", logConfig)) |