@@ -304,9 +304,13 @@ def test_exec_command_tty_stream_no_demux(self):
304
304
# tty=True, stream=True, demux=False
305
305
res = self .client .exec_create (self .container , self .cmd , tty = True )
306
306
exec_log = list (self .client .exec_start (res , stream = True ))
307
- assert len (exec_log ) == 2
308
307
assert b'hello out\r \n ' in exec_log
309
- assert b'hello err\r \n ' in exec_log
308
+ if len (exec_log ) == 2 :
309
+ assert b'hello err\r \n ' in exec_log
310
+ else :
311
+ assert len (exec_log ) == 3
312
+ assert b'hello err' in exec_log
313
+ assert b'\r \n ' in exec_log
310
314
311
315
def test_exec_command_tty_no_stream_demux (self ):
312
316
# tty=True, stream=False, demux=True
@@ -318,6 +322,10 @@ def test_exec_command_tty_stream_demux(self):
318
322
# tty=True, stream=True, demux=True
319
323
res = self .client .exec_create (self .container , self .cmd , tty = True )
320
324
exec_log = list (self .client .exec_start (res , demux = True , stream = True ))
321
- assert len (exec_log ) == 2
322
325
assert (b'hello out\r \n ' , None ) in exec_log
323
- assert (b'hello err\r \n ' , None ) in exec_log
326
+ if len (exec_log ) == 2 :
327
+ assert (b'hello err\r \n ' , None ) in exec_log
328
+ else :
329
+ assert len (exec_log ) == 3
330
+ assert (b'hello err' , None ) in exec_log
331
+ assert (b'\r \n ' , None ) in exec_log
0 commit comments