python类getproxies_environment()的实例源码

test_urllib_toplevel.py 文件源码 项目:packaging 作者: blockstack 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def test_getproxies_environment_keep_no_proxies(self):
        self.env.set('NO_PROXY', 'localhost')
        proxies = urllib_request.getproxies_environment()
        # getproxies_environment use lowered case truncated (no '_proxy') keys
        self.assertEqual('localhost', proxies['no'])
        # List of no_proxies with space.
        self.env.set('NO_PROXY', 'localhost, anotherdomain.com, newdomain.com')
        self.assertTrue(urllib_request.proxy_bypass_environment('anotherdomain.com'))


问题


面经


文章

微信
公众号

扫码关注公众号