diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-01-08 12:39:11 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-01-08 12:39:26 -0800 |
commit | 74e06aff9e1869dece030b61e99365150fb2e315 (patch) | |
tree | 74e2dbd451be08f022ae67de769de7bfa2ab8375 /tests/test_client.py | |
parent | 78d9e4834cb9e4bb0060b419c8677660b016f4d2 (diff) |
Small refactor
Diffstat (limited to 'tests/test_client.py')
-rw-r--r-- | tests/test_client.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_client.py b/tests/test_client.py index 7be2d73e..ad80e720 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -199,12 +199,14 @@ class SSHClientTest (unittest.TestCase): client = paramiko.SSHClient() self.assertEquals(0, len(client.get_host_keys())) - client.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key) + host_id = '[%s]:%d' % (self.addr, self.port) + + client.get_host_keys().add(host_id, 'ssh-rsa', public_host_key) self.assertEquals(1, len(client.get_host_keys())) - self.assertEquals(public_host_key, client.get_host_keys()['[%s]:%d' % (self.addr, self.port)]['ssh-rsa']) + self.assertEquals(public_host_key, client.get_host_keys()[host_id]['ssh-rsa']) client.save_host_keys(localname) - self.assertEquals(len('[%s]:%d' % (self.addr, self.port)) + 210, os.path.getsize(localname)) + self.assertEquals(len(host_id) + 210, os.path.getsize(localname)) os.unlink(localname) |