summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2018-05-29 14:12:04 +0200
committerGitHub <noreply@github.com>2018-05-29 14:12:04 +0200
commit99afe2080a5ffb5e5011daebce3ddbb5133d9088 (patch)
tree6a0d71acfadb10ce486910626eb2baac5107cf46 /tests
parent50205e3534ca79337b27f04d0f47f984a7fbb4b7 (diff)
parent42e14b8bf195d712e1a7bb295c7e774094fb1496 (diff)
downloadpexpect-git-99afe2080a5ffb5e5011daebce3ddbb5133d9088.tar.gz
Merge pull request #490 from Red-M/master
Update docs and add SSH config file passing
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pxssh.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/test_pxssh.py b/tests/test_pxssh.py
index 285ec73..5f82302 100644
--- a/tests/test_pxssh.py
+++ b/tests/test_pxssh.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import os
-
+import tempfile
import unittest
from pexpect import pxssh
@@ -85,6 +85,13 @@ class PxsshTestCase(SSHTestBase):
if confirmation_strings!=len(confirmation_array):
assert False, 'String generated from remote tunneling is incorrect.'
+ def test_ssh_config_passing_string(self):
+ ssh = pxssh.pxssh(debug_command_string=True)
+ (temp_file,config_path) = tempfile.mkstemp()
+ string = ssh.login('server', 'me', password='s3cret', spawn_local_ssh=False, ssh_config=config_path)
+ if not '-F '+config_path in string:
+ assert False, 'String generated from SSH config passing is incorrect.'
+
def test_ssh_key_string(self):
ssh = pxssh.pxssh(debug_command_string=True)
confirmation_strings = 0
@@ -98,8 +105,9 @@ class PxsshTestCase(SSHTestBase):
assert False, 'String generated from forcing the SSH agent sock is incorrect.'
confirmation_strings = 0
- confirmation_array = [' -i True']
- string = ssh.login('server', 'me', password='s3cret', ssh_key='True')
+ (temp_file,ssh_key) = tempfile.mkstemp()
+ confirmation_array = [' -i '+ssh_key]
+ string = ssh.login('server', 'me', password='s3cret', ssh_key=ssh_key)
for confirmation in confirmation_array:
if confirmation in string:
confirmation_strings+=1