test_util.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:obsoleted-vpduserv 作者: InfraSIM 项目源码 文件源码
def test_12_host_config_test_proxycommand(self):
        test_config_file = """
Host proxy-with-equal-divisor-and-space
ProxyCommand = foo=bar

Host proxy-with-equal-divisor-and-no-space
ProxyCommand=foo=bar

Host proxy-without-equal-divisor
ProxyCommand foo=bar:%h-%p
    """
        for host, values in {
            'proxy-with-equal-divisor-and-space'   :{'hostname': 'proxy-with-equal-divisor-and-space',
                                                     'proxycommand': 'foo=bar'},
            'proxy-with-equal-divisor-and-no-space':{'hostname': 'proxy-with-equal-divisor-and-no-space',
                                                     'proxycommand': 'foo=bar'},
            'proxy-without-equal-divisor'          :{'hostname': 'proxy-without-equal-divisor',
                                                     'proxycommand':
                                                     'foo=bar:proxy-without-equal-divisor-22'}
        }.items():

            f = StringIO(test_config_file)
            config = paramiko.util.parse_ssh_config(f)
            self.assertEqual(
                paramiko.util.lookup_ssh_host_config(host, config),
                values
            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号