summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJan Brauer <jan@jimdo.com>2012-07-12 17:12:26 +0200
committerJeff Forcier <jeff@bitprophet.org>2012-09-23 16:45:49 -0700
commitd18b8cf1e9aab43abc9f6750fd9fb15f356435e4 (patch)
treeb2e2196fefe6b1b7380140678955f5c8c81cf77e /tests
parentd3dc9fcb19af0e2660cd36028fb226bb2c11f527 (diff)
Fix #33 - parse config as described by manpage
(cherry picked from commit 011805eae07ee7be6140b95f6d8669763c55b3d9)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_util.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index e3c9dfeb..ed0607fa 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -159,3 +159,21 @@ class UtilTest (unittest.TestCase):
x = rng.read(32)
self.assertEquals(len(x), 32)
+ def test_7_host_config_expose_issue_33(self):
+ test_config_file = """
+Host www13.*
+ Port 22
+
+Host *.example.com
+ Port 2222
+
+Host *
+ Port 3333
+ """
+ f = cStringIO.StringIO(test_config_file)
+ config = ssh.util.parse_ssh_config(f)
+ host = 'www13.example.com'
+ self.assertEquals(
+ ssh.util.lookup_ssh_host_config(host, config),
+ {'hostname': host, 'port': '22'}
+ )