1
0
mirror of https://github.com/moby/moby.git synced 2025-07-29 07:21:35 +03:00

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>
This commit is contained in:
Sebastiaan van Stijn
2019-09-11 12:57:29 +02:00
parent 09226c4442
commit 0fabf3e41e
30 changed files with 181 additions and 187 deletions

View File

@ -36,7 +36,7 @@ func (s *DockerSuite) TestCreateArgs(c *testing.T) {
}
err := json.Unmarshal([]byte(out), &containers)
assert.Assert(c, err == nil, fmt.Sprintf("Error inspecting the container: %s", err))
assert.Assert(c, err == nil, "Error inspecting the container: %s", err)
assert.Equal(c, len(containers), 1)
cont := containers[0]
@ -95,12 +95,12 @@ func (s *DockerSuite) TestCreateHostConfig(c *testing.T) {
}
err := json.Unmarshal([]byte(out), &containers)
assert.Assert(c, err == nil, fmt.Sprintf("Error inspecting the container: %s", err))
assert.Assert(c, err == nil, "Error inspecting the container: %s", err)
assert.Equal(c, len(containers), 1)
cont := containers[0]
assert.Assert(c, cont.HostConfig != nil, fmt.Sprintf("Expected HostConfig, got none"))
assert.Assert(c, cont.HostConfig.PublishAllPorts, fmt.Sprintf("Expected PublishAllPorts, got false"))
assert.Assert(c, cont.HostConfig != nil, "Expected HostConfig, got none")
assert.Assert(c, cont.HostConfig.PublishAllPorts, "Expected PublishAllPorts, got false")
}
func (s *DockerSuite) TestCreateWithPortRange(c *testing.T) {
@ -116,12 +116,12 @@ func (s *DockerSuite) TestCreateWithPortRange(c *testing.T) {
}
}
err := json.Unmarshal([]byte(out), &containers)
assert.Assert(c, err == nil, fmt.Sprintf("Error inspecting the container: %s", err))
assert.Assert(c, err == nil, "Error inspecting the container: %s", err)
assert.Equal(c, len(containers), 1)
cont := containers[0]
assert.Assert(c, cont.HostConfig != nil, fmt.Sprintf("Expected HostConfig, got none"))
assert.Assert(c, cont.HostConfig != nil, "Expected HostConfig, got none")
assert.Equal(c, len(cont.HostConfig.PortBindings), 4, fmt.Sprintf("Expected 4 ports bindings, got %d", len(cont.HostConfig.PortBindings)))
for k, v := range cont.HostConfig.PortBindings {
@ -146,11 +146,11 @@ func (s *DockerSuite) TestCreateWithLargePortRange(c *testing.T) {
}
err := json.Unmarshal([]byte(out), &containers)
assert.Assert(c, err == nil, fmt.Sprintf("Error inspecting the container: %s", err))
assert.Assert(c, err == nil, "Error inspecting the container: %s", err)
assert.Equal(c, len(containers), 1)
cont := containers[0]
assert.Assert(c, cont.HostConfig != nil, fmt.Sprintf("Expected HostConfig, got none"))
assert.Assert(c, cont.HostConfig != nil, "Expected HostConfig, got none")
assert.Equal(c, len(cont.HostConfig.PortBindings), 65535)
for k, v := range cont.HostConfig.PortBindings {
@ -178,7 +178,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 == nil, fmt.Sprintf("Error getting volume host path: %q", err))
assert.Assert(c, err == nil, "Error getting volume host path: %q", err)
if _, err := os.Stat(dir); err != nil && os.IsNotExist(err) {
c.Fatalf("Volume was not created")