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
|
@ -5,8 +5,8 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/docker/docker/integration-cli/checker"
|
||||
"github.com/go-check/check"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
func (s *DockerSuite) TestPluginLogDriver(c *check.C) {
|
||||
|
@ -17,11 +17,11 @@ func (s *DockerSuite) TestPluginLogDriver(c *check.C) {
|
|||
dockerCmd(c, "plugin", "install", pluginName)
|
||||
dockerCmd(c, "run", "--log-driver", pluginName, "--name=test", "busybox", "echo", "hello")
|
||||
out, _ := dockerCmd(c, "logs", "test")
|
||||
c.Assert(strings.TrimSpace(out), checker.Equals, "hello")
|
||||
assert.Equal(c, strings.TrimSpace(out), "hello")
|
||||
|
||||
dockerCmd(c, "start", "-a", "test")
|
||||
out, _ = dockerCmd(c, "logs", "test")
|
||||
c.Assert(strings.TrimSpace(out), checker.Equals, "hello\nhello")
|
||||
assert.Equal(c, strings.TrimSpace(out), "hello\nhello")
|
||||
|
||||
dockerCmd(c, "rm", "test")
|
||||
dockerCmd(c, "plugin", "disable", pluginName)
|
||||
|
@ -36,13 +36,13 @@ func (s *DockerSuite) TestPluginLogDriverInfoList(c *check.C) {
|
|||
dockerCmd(c, "plugin", "install", pluginName)
|
||||
|
||||
cli, err := client.NewClientWithOpts(client.FromEnv)
|
||||
c.Assert(err, checker.IsNil)
|
||||
assert.NilError(c, err)
|
||||
defer cli.Close()
|
||||
|
||||
info, err := cli.Info(context.Background())
|
||||
c.Assert(err, checker.IsNil)
|
||||
assert.NilError(c, err)
|
||||
|
||||
drivers := strings.Join(info.Plugins.Log, " ")
|
||||
c.Assert(drivers, checker.Contains, "json-file")
|
||||
c.Assert(drivers, checker.Not(checker.Contains), pluginName)
|
||||
assert.Assert(c, strings.Contains(drivers, "json-file"))
|
||||
assert.Assert(c, !strings.Contains(drivers, pluginName))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue