summaryrefslogtreecommitdiffhomepage
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2016-04-25 18:44:56 -0700
committerJeff Forcier <jeff@bitprophet.org>2016-04-25 18:44:56 -0700
commita9f222be52639e82ecdd9839293df5f3f74f6673 (patch)
treeea25c45c2ce61b1554dac64673a92fd65397638e /tests/test_util.py
parent5c97c4a05cbc2c3c3515aec9913622470503eee7 (diff)
parent7d66aa62e7b8074a643d84cd4324c58750b10f1d (diff)
Merge branch '1.15' into 1.16
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index a6a2c30b..e25f0563 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -485,3 +485,33 @@ Host proxycommand-with-equals-none
paramiko.util.lookup_ssh_host_config(host, config),
values
)
+
+ def test_proxycommand_none_masking(self):
+ # Re: https://github.com/paramiko/paramiko/issues/670
+ source_config = """
+Host specific-host
+ ProxyCommand none
+
+Host other-host
+ ProxyCommand other-proxy
+
+Host *
+ ProxyCommand default-proxy
+"""
+ config = paramiko.SSHConfig()
+ config.parse(StringIO(source_config))
+ # When bug is present, the full stripping-out of specific-host's
+ # ProxyCommand means it actually appears to pick up the default
+ # ProxyCommand value instead, due to cascading. It should (for
+ # backwards compatibility reasons in 1.x/2.x) appear completely blank,
+ # as if the host had no ProxyCommand whatsoever.
+ # Threw another unrelated host in there just for sanity reasons.
+ self.assertFalse('proxycommand' in config.lookup('specific-host'))
+ self.assertEqual(
+ config.lookup('other-host')['proxycommand'],
+ 'other-proxy'
+ )
+ self.assertEqual(
+ config.lookup('some-random-host')['proxycommand'],
+ 'default-proxy'
+ )