summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRed_M <pooatyou.com@gmail.com>2018-05-29 20:19:36 +1000
committerRed_M <pooatyou.com@gmail.com>2018-05-29 20:19:36 +1000
commit501217ccc2ef169b5dcbcf7f618380100b0e9126 (patch)
treeaf6fca2a8f4074c36d11db6cfccfe2a2c889c073 /tests
parent23f84c0fd845487da24d792d950f7da3b84c72be (diff)
downloadpexpect-git-501217ccc2ef169b5dcbcf7f618380100b0e9126.tar.gz
Fix as per #490 comments.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pxssh.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_pxssh.py b/tests/test_pxssh.py
index 452e997..d5a5bc4 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
@@ -87,7 +87,7 @@ class PxsshTestCase(SSHTestBase):
def test_ssh_config_passing_string(self):
ssh = pxssh.pxssh(debug_command_string=True)
- config_path = '/fakepath/fake/config_file'
+ (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.'
@@ -106,7 +106,8 @@ class PxsshTestCase(SSHTestBase):
confirmation_strings = 0
confirmation_array = [' -i True']
- string = ssh.login('server', 'me', password='s3cret', ssh_key='True')
+ (temp_file,ssh_key) = tempfile.mkstemp()
+ string = ssh.login('server', 'me', password='s3cret', ssh_key=ssh_key)
for confirmation in confirmation_array:
if confirmation in string:
confirmation_strings+=1