From f04ddd420d0f92accf6142b94fcb25b93ebc14fa Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Mon, 7 May 2012 22:03:13 -0700 Subject: [PATCH] Fix broken tests (cherry picked from commit 00e1072ee5abbc92b5df57e10cadb638d583d971) Conflicts: tests/test_util.py --- tests/test_util.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/test_util.py b/tests/test_util.py index 256c3d7..e3c9dfe 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)