diff options
author | Olle Lundberg <geek@nerd.sh> | 2012-10-16 13:53:06 +0200 |
---|---|---|
committer | Olle Lundberg <geek@nerd.sh> | 2013-02-28 12:06:51 +0100 |
commit | 21689d964798fbbd037e7b995088cee883796225 (patch) | |
tree | 401150cff328b693abc1065107792aec3177c3ad /tests/test_util.py | |
parent | 98ae4e975dd8fd25af4b615bbbd034cc0831e1fa (diff) |
Add test for host negation.
Diffstat (limited to 'tests/test_util.py')
-rw-r--r-- | tests/test_util.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_util.py b/tests/test_util.py index 348b796e..4bb34da5 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -249,3 +249,25 @@ Host portonly host_config(host, config)['proxycommand'], val ) + + def test_11_host_config_test_negation(self): + test_config_file = """ +Host www13.* !*.example.com + Port 22 + +Host *.example.com !www13.* + Port 2222 + +Host www13.* + Port 8080 + +Host * + Port 3333 + """ + f = cStringIO.StringIO(test_config_file) + config = paramiko.util.parse_ssh_config(f) + host = 'www13.example.com' + self.assertEquals( + paramiko.util.lookup_ssh_host_config(host, config), + {'hostname': host, 'port': '8080'} + ) |