1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

intgration-cli: fix formatting

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit cc01289792)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Tibor Vass 2019-09-09 21:35:23 +00:00 committed by Sebastiaan van Stijn
parent cf50c5bba8
commit d98c74d38d
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
5 changed files with 12 additions and 67 deletions

View file

@ -1064,12 +1064,7 @@ func (s *DockerSuite) TestContainerAPICopyResourcePathEmptyPre124(c *testing.T)
}
b, err := request.ReadBody(body)
assert.NilError(c, err)
assert.Assert(c, is.Regexp("^"+
"Path cannot be empty\n"+
"$",
string(b)))
assert.Assert(c, is.Regexp("^Path cannot be empty\n$", string(b)))
}
@ -1091,12 +1086,7 @@ func (s *DockerSuite) TestContainerAPICopyResourcePathNotFoundPre124(c *testing.
}
b, err := request.ReadBody(body)
assert.NilError(c, err)
assert.Assert(c, is.Regexp("^"+
("Could not find the file /notexist in container "+name+"\n")+
"$",
string(b)))
assert.Assert(c, is.Regexp("^Could not find the file /notexist in container "+name+"\n$", string(b)))
}

View file

@ -4799,12 +4799,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToFile(c *testing.T) {
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "target").Combined()
assert.Assert(c, cmp.Regexp("^"+
"bar"+
"$",
out))
assert.Assert(c, cmp.Regexp("^bar$", out))
// change target file should invalidate cache
err = ioutil.WriteFile(filepath.Join(ctx.Dir, "foo"), []byte("baz"), 0644)
@ -4813,12 +4808,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToFile(c *testing.T) {
result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
out = cli.DockerCmd(c, "run", "--rm", name, "cat", "target").Combined()
assert.Assert(c, cmp.Regexp("^"+
"baz"+
"$",
out))
assert.Assert(c, cmp.Regexp("^baz$", out))
}
@ -4840,12 +4830,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToDir(c *testing.T) {
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
assert.Assert(c, cmp.Regexp("^"+
"barbaz"+
"$",
out))
assert.Assert(c, cmp.Regexp("^barbaz$", out))
// change target file should invalidate cache
err = ioutil.WriteFile(filepath.Join(ctx.Dir, "foo/def"), []byte("bax"), 0644)
@ -4854,12 +4839,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToDir(c *testing.T) {
result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
out = cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
assert.Assert(c, cmp.Regexp("^"+
"barbax"+
"$",
out))
assert.Assert(c, cmp.Regexp("^barbax$", out))
}
@ -4882,12 +4862,7 @@ func (s *DockerSuite) TestBuildSymlinkBasename(c *testing.T) {
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "asymlink").Combined()
assert.Assert(c, cmp.Regexp("^"+
"bar"+
"$",
out))
assert.Assert(c, cmp.Regexp("^bar$", out))
}

View file

@ -115,11 +115,7 @@ func (s *DockerSuite) TestHistoryHumanOptionTrue(c *testing.T) {
endIndex = len(lines[i])
}
sizeString := lines[i][startIndex:endIndex]
assert.Assert(c, cmp.Regexp("^"+
humanSizeRegexRaw+
"$",
assert.Assert(c, cmp.Regexp("^"+humanSizeRegexRaw+"$",
strings.TrimSpace(sizeString)), fmt.Sprintf("The size '%s' was not in human format", sizeString))
}
}

View file

@ -90,21 +90,11 @@ func (s *DockerSuite) TestImagesFilterLabelMatch(c *testing.T) {
out, _ := dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match")
out = strings.TrimSpace(out)
assert.Assert(c, is.Regexp("^"+
assert.Assert(c, is.Regexp(fmt.Sprintf("^[\\s\\w:]*%s[\\s\\w:]*$", image1ID), out))
fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image1ID)+
"$",
assert.Assert(c, is.Regexp(fmt.Sprintf("^[\\s\\w:]*%s[\\s\\w:]*$", image2ID), out))
out))
assert.Assert(c, is.Regexp("^"+
fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image2ID)+
"$",
out))
assert.Assert(c, !is.Regexp("^"+fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image3ID)+"$", out)().Success())
assert.Assert(c, !is.Regexp(fmt.Sprintf("^[\\s\\w:]*%s[\\s\\w:]*$", image3ID), out)().Success())
out, _ = dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match=me too")
out = strings.TrimSpace(out)

View file

@ -229,13 +229,7 @@ func (s *DockerSuite) TestLinksEtcHostsRegularFile(c *testing.T) {
testRequires(c, DaemonIsLinux, NotUserNamespace)
out, _ := dockerCmd(c, "run", "--net=host", "busybox", "ls", "-la", "/etc/hosts")
// /etc/hosts should be a regular file
assert.Assert(c, cmp.Regexp("^"+
"^-.+\n"+
"$",
out))
assert.Assert(c, cmp.Regexp("^-.+\n$", out))
}
func (s *DockerSuite) TestLinksMultipleWithSameName(c *testing.T) {