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

Replace some checkers and assertions with gotest.tools

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-04-04 15:23:19 +02:00
parent 86f2ac4a6b
commit 6345208b9b
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
82 changed files with 2931 additions and 3030 deletions

View file

@ -21,6 +21,7 @@ import (
"github.com/docker/docker/internal/test/fakecontext"
"github.com/docker/go-units"
"github.com/go-check/check"
"gotest.tools/assert"
"gotest.tools/icmd"
)
@ -96,7 +97,7 @@ func (s *DockerSuite) TestBuildAddChangeOwnership(c *check.C) {
RUN [ $(stat -c %U:%G "/bar/foo") = 'root:root' ]
`
tmpDir, err := ioutil.TempDir("", "fake-context")
c.Assert(err, check.IsNil)
assert.NilError(c, err)
testFile, err := os.Create(filepath.Join(tmpDir, "foo"))
if err != nil {
c.Fatalf("failed to create foo file: %v", err)
@ -135,9 +136,9 @@ func (s *DockerSuite) TestBuildCancellationKillsSleep(c *check.C) {
name := "testbuildcancellation"
observer, err := newEventObserver(c)
c.Assert(err, checker.IsNil)
assert.NilError(c, err)
err = observer.Start()
c.Assert(err, checker.IsNil)
assert.NilError(c, err)
defer observer.Stop()
// (Note: one year, will never finish)
@ -148,7 +149,7 @@ func (s *DockerSuite) TestBuildCancellationKillsSleep(c *check.C) {
buildCmd.Dir = ctx.Dir
stdoutBuild, err := buildCmd.StdoutPipe()
c.Assert(err, checker.IsNil)
assert.NilError(c, err)
if err := buildCmd.Start(); err != nil {
c.Fatalf("failed to run build: %s", err)