test_requests.py 文件源码

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

项目:Codeforces-Sublime-Plugin 作者: karunk 项目源码 文件源码
def test_get_environ_proxies(self):
        """Ensures that IP addresses are correctly matches with ranges
        in no_proxy variable."""
        from requests.utils import get_environ_proxies
        os.environ['no_proxy'] = "127.0.0.1,localhost.localdomain,192.168.0.0/24,172.16.1.1"
        assert get_environ_proxies(
            'http://localhost.localdomain:5000/v1.0/') == {}
        assert get_environ_proxies('http://www.requests.com/') != {}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号