Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions tests/integration/api_exec_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,9 @@ def test_exec_command_tty_stream_no_demux(self):
# tty=True, stream=True, demux=False
res = self.client.exec_create(self.container, self.cmd, tty=True)
exec_log = list(self.client.exec_start(res, stream=True))
assert b'hello out\r\n' in exec_log
if len(exec_log) == 2:
assert b'hello err\r\n' in exec_log
else:
assert len(exec_log) == 3
assert b'hello err' in exec_log
assert b'\r\n' in exec_log
merged = b''.join(chunk for chunk in exec_log)
assert b'hello out\r\n' in merged
assert b'hello err\r\n' in merged

def test_exec_command_tty_no_stream_demux(self):
# tty=True, stream=False, demux=True
Expand All @@ -304,10 +300,6 @@ def test_exec_command_tty_stream_demux(self):
# tty=True, stream=True, demux=True
res = self.client.exec_create(self.container, self.cmd, tty=True)
exec_log = list(self.client.exec_start(res, demux=True, stream=True))
assert (b'hello out\r\n', None) in exec_log
if len(exec_log) == 2:
assert (b'hello err\r\n', None) in exec_log
else:
assert len(exec_log) == 3
assert (b'hello err', None) in exec_log
assert (b'\r\n', None) in exec_log
merged = b''.join(chunk for chunk, _ in exec_log)
assert b'hello out\r\n' in merged
assert b'hello err\r\n' in merged
Loading