From b788056982e415d4763d930a650fac437bd076ce Mon Sep 17 00:00:00 2001 From: qqo Date: Wed, 20 Jul 2016 16:06:22 +0300 Subject: Add tests for ~ expansion inside proxycommand --- tests/test_util.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/test_util.py') diff --git a/tests/test_util.py b/tests/test_util.py index e25f0563..87624711 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -248,6 +248,19 @@ Host * val ) + def test_11_proxycommand_tilde_expansion(self): + """ + Tilde (~) should be expanded inside ProxyCommand + """ + config = paramiko.util.parse_ssh_config(StringIO(""" +Host test + ProxyCommand ssh -F ~/.ssh/test_config bastion nc %h %p +""")) + self.assertEqual( + 'ssh -F %s/.ssh/test_config bastion nc test 22' % os.path.expanduser('~'), + host_config('test', config)['proxycommand'] + ) + def test_11_host_config_test_negation(self): test_config_file = """ Host www13.* !*.example.com -- cgit v1.2.3