test_packageindex.py 文件源码

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

项目:browser_vuln_check 作者: lcatro 项目源码 文件源码
def test_bad_url_bad_status_line(self):
        index = setuptools.package_index.PackageIndex(
            hosts=('www.example.com',)
        )

        def _urlopen(*args):
            raise http_client.BadStatusLine('line')

        index.opener = _urlopen
        url = 'http://example.com'
        try:
            v = index.open_url(url)
        except Exception as v:
            assert 'line' in str(v)
        else:
            raise AssertionError('Should have raise here!')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号