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:
parent
86f2ac4a6b
commit
6345208b9b
82 changed files with 2931 additions and 3030 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue