From 45108f0650c09680d0d0b7d7d3be4eeb86b8494d Mon Sep 17 00:00:00 2001 From: Red_M Date: Fri, 30 Mar 2018 12:08:44 +1000 Subject: Bug fix unit test for SSH tunnels. --- tests/test_pxssh.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/test_pxssh.py b/tests/test_pxssh.py index 0944fc5..f68a1cc 100644 --- a/tests/test_pxssh.py +++ b/tests/test_pxssh.py @@ -61,10 +61,14 @@ class PxsshTestCase(SSHTestBase): ssh = pxssh.pxssh(debug_tunnel_command=True) tunnels = { 'local': ['2424:localhost:22'],'remote': ['2525:localhost:22'], 'dynamic': [8888] } - confirmation_string = 'ssh -q -R 2525:localhost:22 -L 2424:localhost:22 -D 8888 -l me server' + confirmation_strings = 0 + confirmation_array = ['-R 2525:localhost:22','-L 2424:localhost:22','-D 8888'] string = ssh.login('server', 'me', password='s3cret', ssh_tunnels=tunnels) - if string!=confirmation_string: - print(string) + for confirmation in confirmation_array: + if confirmation in string: + confirmation_strings+=1 + + if confirmation_strings!=3: assert False, 'String generated from tunneling is potientally incorrect.' -- cgit v1.2.1