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:
@ -27,7 +27,7 @@ func (s *DockerSuite) TestLinksInvalidContainerTarget(c *testing.T) {
|
||||
out, _, err := dockerCmdWithError("run", "--link", "bogus:alias", "busybox", "true")
|
||||
|
||||
// an invalid container target should produce an error
|
||||
assert.Assert(c, err != nil, fmt.Sprintf("out: %s", out))
|
||||
assert.Assert(c, err != nil, "out: %s", out)
|
||||
// an invalid container target should produce an error
|
||||
// note: convert the output to lowercase first as the error string
|
||||
// capitalization was changed after API version 1.32
|
||||
@ -169,7 +169,7 @@ func (s *DockerSuite) TestLinksUpdateOnRestart(c *testing.T) {
|
||||
getIP := func(hosts []byte, hostname string) string {
|
||||
re := regexp.MustCompile(fmt.Sprintf(`(\S*)\t%s`, regexp.QuoteMeta(hostname)))
|
||||
matches := re.FindSubmatch(hosts)
|
||||
assert.Assert(c, matches != nil, fmt.Sprintf("Hostname %s have no matches in hosts", hostname))
|
||||
assert.Assert(c, matches != nil, "Hostname %s have no matches in hosts", hostname)
|
||||
return string(matches[1])
|
||||
}
|
||||
ip := getIP(content, "one")
|
||||
@ -220,7 +220,7 @@ func (s *DockerSuite) TestLinksNetworkHostContainer(c *testing.T) {
|
||||
out, _, err := dockerCmdWithError("run", "--name", "should_fail", "--link", "host_container:tester", "busybox", "true")
|
||||
|
||||
// Running container linking to a container with --net host should have failed
|
||||
assert.Assert(c, err != nil, fmt.Sprintf("out: %s", out))
|
||||
assert.Assert(c, err != nil, "out: %s", out)
|
||||
// Running container linking to a container with --net host should have failed
|
||||
assert.Assert(c, strings.Contains(out, runconfig.ErrConflictHostNetworkAndLinks.Error()))
|
||||
}
|
||||
|
Reference in New Issue
Block a user