@ -7,8 +7,9 @@ import (
|
||||
|
||||
"github.com/docker/cli/cli/command"
|
||||
"github.com/docker/cli/cli/debug"
|
||||
"github.com/gotestyourself/gotestyourself/assert"
|
||||
is "github.com/gotestyourself/gotestyourself/assert/cmp"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestClientDebugEnabled(t *testing.T) {
|
||||
@ -18,9 +19,9 @@ func TestClientDebugEnabled(t *testing.T) {
|
||||
cmd.Flags().Set("debug", "true")
|
||||
|
||||
err := cmd.PersistentPreRunE(cmd, []string{})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "1", os.Getenv("DEBUG"))
|
||||
assert.Equal(t, logrus.DebugLevel, logrus.GetLevel())
|
||||
assert.Check(t, err)
|
||||
assert.Check(t, is.Equal("1", os.Getenv("DEBUG")))
|
||||
assert.Check(t, is.Equal(logrus.DebugLevel, logrus.GetLevel()))
|
||||
}
|
||||
|
||||
func TestExitStatusForInvalidSubcommandWithHelpFlag(t *testing.T) {
|
||||
@ -28,5 +29,5 @@ func TestExitStatusForInvalidSubcommandWithHelpFlag(t *testing.T) {
|
||||
cmd := newDockerCommand(command.NewDockerCli(os.Stdin, discard, discard))
|
||||
cmd.SetArgs([]string{"help", "invalid"})
|
||||
err := cmd.Execute()
|
||||
assert.EqualError(t, err, "unknown help topic: invalid")
|
||||
assert.Check(t, is.Error(err, "unknown help topic: invalid"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user