File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,16 @@ def ssh_channel(ssh_client_session):
36
36
@pytest .mark .forked
37
37
def exec_second_command (ssh_channel ):
38
38
"""Check the standard output of ``exec_command()`` as a string."""
39
- u_cmd_out = ssh_channel .exec_command ('echo -n Hello Again' ).stdout .decode ()
40
- assert u_cmd_out == u'Hello Again' # noqa: WPS302
39
+ u_cmd = ssh_channel .exec_command ('echo -n Hello Again' )
40
+ assert u_cmd .returncode == 0
41
+ assert u_cmd .stdout .decode () == u'Hello Again' # noqa: WPS302
41
42
42
43
43
44
def test_exec_command (ssh_channel ):
44
45
"""Test getting the output of a remotely executed command."""
45
- u_cmd_out = ssh_channel .exec_command ('echo -n Hello World' ).stdout .decode ()
46
- assert u_cmd_out == u'Hello World' # noqa: WPS302
46
+ u_cmd = ssh_channel .exec_command ('echo -n Hello World' )
47
+ assert u_cmd .returncode == 0
48
+ assert u_cmd .stdout .decode () == u'Hello World' # noqa: WPS302
47
49
# Test that repeated calls to exec_command do not segfault.
48
50
49
51
# NOTE: Call `exec_command()` once again from another function to
You can’t perform that action at this time.
0 commit comments