diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2012-05-07 22:03:13 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2012-09-23 16:45:28 -0700 |
commit | f04ddd420d0f92accf6142b94fcb25b93ebc14fa (patch) | |
tree | 9df6a6b98852b22198ca2baabdee4d0b5b4aa0ce /tests | |
parent | 01735419f3094852b650d34368c1e1126c9767a4 (diff) |
Fix broken tests
(cherry picked from commit 00e1072ee5abbc92b5df57e10cadb638d583d971)
Conflicts:
tests/test_util.py
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_util.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/test_util.py b/tests/test_util.py index 256c3d7c..e3c9dfeb 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -120,12 +120,19 @@ class UtilTest (unittest.TestCase): global test_config_file f = cStringIO.StringIO(test_config_file) config = paramiko.util.parse_ssh_config(f) - c = paramiko.util.lookup_ssh_host_config('irc.danger.com', config) - self.assertEquals(c, {'identityfile': '~/.ssh/id_rsa', 'user': 'robey', 'crazy': 'something dumb '}) - c = paramiko.util.lookup_ssh_host_config('irc.example.com', config) - self.assertEquals(c, {'identityfile': '~/.ssh/id_rsa', 'user': 'bjork', 'crazy': 'something dumb ', 'port': '3333'}) - c = paramiko.util.lookup_ssh_host_config('spoo.example.com', config) - self.assertEquals(c, {'identityfile': '~/.ssh/id_rsa', 'user': 'bjork', 'crazy': 'something else', 'port': '3333'}) + for host, values in { + 'irc.danger.com': {'user': 'robey', 'crazy': 'something dumb '}, + 'irc.example.com': {'user': 'bjork', 'crazy': 'something dumb ', 'port': '3333'}, + 'spoo.example.com': {'user': 'bjork', 'crazy': 'something else', 'port': '3333'} + }.items(): + values = dict(values, + hostname=host, + identityfile=os.path.expanduser("~/.ssh/id_rsa") + ) + self.assertEquals( + paramiko.util.lookup_ssh_host_config(host, config), + values + ) def test_4_generate_key_bytes(self): x = paramiko.util.generate_key_bytes(SHA, 'ABCDEFGH', 'This is my secret passphrase.', 64) |