summaryrefslogtreecommitdiffhomepage
path: root/tests/test_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_client.py')
-rw-r--r--tests/test_client.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_client.py b/tests/test_client.py
index 91aac334..0959ac9a 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -86,8 +86,8 @@ class SSHClientTest (unittest.TestCase):
"""
verify that the SSHClient stuff works too.
"""
- public_host_key = paramiko.RSAKey(data=str(host_key))
host_key = paramiko.RSAKey.from_private_key_file(test_path('test_rsa.key'))
+ public_host_key = paramiko.RSAKey(data=host_key.asbytes())
self.tc = paramiko.SSHClient()
self.tc.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key)
@@ -119,8 +119,8 @@ class SSHClientTest (unittest.TestCase):
"""
verify that SSHClient works with a DSA key.
"""
- public_host_key = paramiko.RSAKey(data=str(host_key))
host_key = paramiko.RSAKey.from_private_key_file(test_path('test_rsa.key'))
+ public_host_key = paramiko.RSAKey(data=host_key.asbytes())
self.tc = paramiko.SSHClient()
self.tc.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key)
@@ -152,8 +152,8 @@ class SSHClientTest (unittest.TestCase):
"""
verify that SSHClient accepts and tries multiple key files.
"""
- public_host_key = paramiko.RSAKey(data=str(host_key))
host_key = paramiko.RSAKey.from_private_key_file(test_path('test_rsa.key'))
+ public_host_key = paramiko.RSAKey(data=host_key.asbytes())
self.tc = paramiko.SSHClient()
self.tc.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key)
@@ -169,8 +169,8 @@ class SSHClientTest (unittest.TestCase):
"""
verify that SSHClient's AutoAddPolicy works.
"""
- public_host_key = paramiko.RSAKey(data=str(host_key))
host_key = paramiko.RSAKey.from_private_key_file(test_path('test_rsa.key'))
+ public_host_key = paramiko.RSAKey(data=host_key.asbytes())
self.tc = paramiko.SSHClient()
self.tc.set_missing_host_key_policy(paramiko.AutoAddPolicy())
@@ -190,8 +190,8 @@ class SSHClientTest (unittest.TestCase):
verify that when an SSHClient is collected, its transport (and the
transport's packetizer) is closed.
"""
- public_host_key = paramiko.RSAKey(data=str(host_key))
host_key = paramiko.RSAKey.from_private_key_file(test_path('test_rsa.key'))
+ public_host_key = paramiko.RSAKey(data=host_key.asbytes())
self.tc = paramiko.SSHClient()
self.tc.set_missing_host_key_policy(paramiko.AutoAddPolicy())