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:
Xiaoxu Chen 2015-10-08 12:43:03 -04:00
parent 6654b0e05f
commit 79498b1c61

View file

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"os/exec" "os/exec"
"github.com/docker/docker/pkg/integration/checker"
"github.com/go-check/check" "github.com/go-check/check"
) )
@ -14,8 +15,7 @@ func (s *DockerSuite) TestLoginWithoutTTY(c *check.C) {
cmd.Stdin = bytes.NewBufferString("buffer test string \n") cmd.Stdin = bytes.NewBufferString("buffer test string \n")
// run the command and block until it's done // run the command and block until it's done
if err := cmd.Run(); err == nil { err := cmd.Run()
c.Fatal("Expected non nil err when loginning in & TTY not available") c.Assert(err, checker.NotNil, check.Commentf("Expected non nil err when loginning in & TTY not available"))
}
} }