summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRed_M <pooatyou.com@gmail.com>2018-03-30 12:08:44 +1000
committerRed_M <pooatyou.com@gmail.com>2018-03-30 12:08:44 +1000
commit45108f0650c09680d0d0b7d7d3be4eeb86b8494d (patch)
treead5c29387b4b5bde14ad06e6bddb3feea97bc259 /tests
parentdedfd4e78a28d05530c3e8e33987a399fec8b934 (diff)
downloadpexpect-git-45108f0650c09680d0d0b7d7d3be4eeb86b8494d.tar.gz
Bug fix unit test for SSH tunnels.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pxssh.py10
1 files changed, 7 insertions, 3 deletions
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.'