github.com/goern/docker@v1.9.0-rc1/integration-cli/docker_cli_login_test.go (about) 1 package main 2 3 import ( 4 "bytes" 5 "os/exec" 6 7 "github.com/docker/docker/pkg/integration/checker" 8 "github.com/go-check/check" 9 ) 10 11 func (s *DockerSuite) TestLoginWithoutTTY(c *check.C) { 12 cmd := exec.Command(dockerBinary, "login") 13 14 // Send to stdin so the process does not get the TTY 15 cmd.Stdin = bytes.NewBufferString("buffer test string \n") 16 17 // run the command and block until it's done 18 err := cmd.Run() 19 c.Assert(err, checker.NotNil) //"Expected non nil err when loginning in & TTY not available" 20 21 }