summaryrefslogtreecommitdiffhomepage
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorOlle Lundberg <geek@nerd.sh>2012-10-16 13:52:21 +0200
committerOlle Lundberg <geek@nerd.sh>2012-10-16 13:52:21 +0200
commit3174b6c894b125426a7a4bae7f934a0dbe64d5b1 (patch)
treed13b25e62b443c82724b1c12a1f61b24d3a654d5 /tests/test_util.py
parent09488c665ba46057648a13a12c76f0c6392a86a1 (diff)
Updated tests for new ssh config format.
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index 7e56245d..6d68af7e 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -112,23 +112,32 @@ class UtilTest (unittest.TestCase):
f = cStringIO.StringIO(test_config_file)
config = paramiko.util.parse_ssh_config(f)
self.assertEquals(config._config,
- [ {'identityfile': '~/.ssh/id_rsa', 'host': '*', 'user': 'robey',
- 'crazy': 'something dumb '},
- {'host': '*.example.com', 'user': 'bjork', 'port': '3333'},
- {'host': 'spoo.example.com', 'crazy': 'something else'}])
+ [{'host': ['*'], 'config': {}}, {'host': ['*'], 'config': {'identityfile': ['~/.ssh/id_rsa'], 'user': 'robey'}},
+ {'host': ['*.example.com'], 'config': {'user': 'bjork', 'port': '3333'}},
+ {'host': ['*'], 'config': {'crazy': 'something dumb '}},
+ {'host': ['spoo.example.com'], 'config': {'crazy': 'something else'}}])
def test_3_host_config(self):
global test_config_file
f = cStringIO.StringIO(test_config_file)
config = paramiko.util.parse_ssh_config(f)
+
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'}
+ 'irc.danger.com': {'crazy': 'something dumb ',
+ 'hostname': 'irc.danger.com',
+ 'user': 'robey'},
+ 'irc.example.com': {'crazy': 'something dumb ',
+ 'hostname': 'irc.example.com',
+ 'user': 'robey',
+ 'port': '3333'},
+ 'spoo.example.com': {'crazy': 'something dumb ',
+ 'hostname': 'spoo.example.com',
+ 'user': 'robey',
+ 'port': '3333'}
}.items():
values = dict(values,
hostname=host,
- identityfile=os.path.expanduser("~/.ssh/id_rsa")
+ identityfile=[os.path.expanduser("~/.ssh/id_rsa")]
)
self.assertEquals(
paramiko.util.lookup_ssh_host_config(host, config),
@@ -159,7 +168,7 @@ class UtilTest (unittest.TestCase):
# just verify that we can pull out 32 bytes and not get an exception.
x = rng.read(32)
self.assertEquals(len(x), 32)
-
+
def test_7_host_config_expose_issue_33(self):
test_config_file = """
Host www13.*