intgration-cli: fix formatting

Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Tibor Vass 2019-09-09 21:35:23 +00:00
parent 8eb9f3f90e
commit cc01289792
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) {