refactor integration-cli/docker_cli_login_test.go with Assert
part of #16756 Signed-off-by: Xiaoxu Chen <chenxiaoxu14@otcaix.iscas.ac.cn>
This commit is contained in:
parent
6654b0e05f
commit
79498b1c61
1 changed files with 3 additions and 3 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"os/exec"
|
||||
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
|
@ -14,8 +15,7 @@ func (s *DockerSuite) TestLoginWithoutTTY(c *check.C) {
|
|||
cmd.Stdin = bytes.NewBufferString("buffer test string \n")
|
||||
|
||||
// run the command and block until it's done
|
||||
if err := cmd.Run(); err == nil {
|
||||
c.Fatal("Expected non nil err when loginning in & TTY not available")
|
||||
}
|
||||
err := cmd.Run()
|
||||
c.Assert(err, checker.NotNil, check.Commentf("Expected non nil err when loginning in & TTY not available"))
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue