Skip to content

Commit 37102e9

Browse files
committed
tests: Check stderr of exec_command
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent 45ec6fa commit 37102e9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/unit/channel_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ def exec_second_command(ssh_channel):
3838
"""Check the standard output of ``exec_command()`` as a string."""
3939
u_cmd = ssh_channel.exec_command('echo -n Hello Again')
4040
assert u_cmd.returncode == 0
41+
assert u_cmd.stderr.decode() == '' # noqa: WPS302
4142
assert u_cmd.stdout.decode() == u'Hello Again' # noqa: WPS302
4243

4344

4445
def test_exec_command(ssh_channel):
4546
"""Test getting the output of a remotely executed command."""
4647
u_cmd = ssh_channel.exec_command('echo -n Hello World')
4748
assert u_cmd.returncode == 0
49+
assert u_cmd.stderr.decode() == ''
4850
assert u_cmd.stdout.decode() == u'Hello World' # noqa: WPS302
4951
# Test that repeated calls to exec_command do not segfault.
5052

0 commit comments

Comments
 (0)