@@ -1092,20 +1092,28 @@ def test_run_container_reading_socket(self):
10921092 command = "printf '{0}'" .format (line )
10931093 container = self .client .create_container (BUSYBOX , command ,
10941094 detach = True , tty = False )
1095- ident = container ['Id' ]
1096- self .tmp_containers .append (ident )
1095+ self .tmp_containers .append (container )
10971096
10981097 opts = {"stdout" : 1 , "stream" : 1 , "logs" : 1 }
1099- pty_stdout = self .client .attach_socket (ident , opts )
1098+ pty_stdout = self .client .attach_socket (container , opts )
11001099 self .addCleanup (pty_stdout .close )
11011100
1102- self .client .start (ident )
1101+ self .client .start (container )
11031102
11041103 next_size = next_frame_size (pty_stdout )
11051104 self .assertEqual (next_size , len (line ))
11061105 data = read_exactly (pty_stdout , next_size )
11071106 self .assertEqual (data .decode ('utf-8' ), line )
11081107
1108+ def test_attach_no_stream (self ):
1109+ container = self .client .create_container (
1110+ BUSYBOX , 'echo hello'
1111+ )
1112+ self .tmp_containers .append (container )
1113+ self .client .start (container )
1114+ output = self .client .attach (container , stream = False , logs = True )
1115+ assert output == 'hello\n ' .encode (encoding = 'ascii' )
1116+
11091117
11101118class PauseTest (BaseAPIIntegrationTest ):
11111119 def test_pause_unpause (self ):
0 commit comments