summaryrefslogtreecommitdiff
path: root/tests/test_config.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2022-04-25 10:42:50 -0400
committerJeff Forcier <jeff@bitprophet.org>2022-04-25 10:43:11 -0400
commitf325261699a1989d7aef1a62e3b3dab96f25d237 (patch)
tree7664e85d9c7d3f1daa50baadc2b36eac63336023 /tests/test_config.py
parent9b22c28a02e5ae0291857a7fb9051cf942280731 (diff)
downloadparamiko-f325261699a1989d7aef1a62e3b3dab96f25d237.tar.gz
Massage #1951 a bit
- changelog - test - tilde makes no sense here (ProxyJump is only ever [user@]host[:port] syntax) so removed it
Diffstat (limited to 'tests/test_config.py')
-rw-r--r--tests/test_config.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index b46dc7b4..45fb262d 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -207,6 +207,25 @@ Host test
assert got == expected
@patch("paramiko.config.getpass")
+ def test_proxyjump_token_expansion(self, getpass):
+ getpass.getuser.return_value = "gandalf"
+ config = SSHConfig.from_text(
+ """
+Host justhost
+ ProxyJump jumpuser@%h
+Host userhost
+ ProxyJump %r@%h:222
+Host allcustom
+ ProxyJump %r@%h:%p
+"""
+ )
+ assert config.lookup("justhost")["proxyjump"] == "jumpuser@justhost"
+ assert config.lookup("userhost")["proxyjump"] == "gandalf@userhost:222"
+ assert (
+ config.lookup("allcustom")["proxyjump"] == "gandalf@allcustom:22"
+ )
+
+ @patch("paramiko.config.getpass")
def test_controlpath_token_expansion(self, getpass, socket):
getpass.getuser.return_value = "gandalf"
config = SSHConfig.from_text(