views_test.py 文件源码

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

项目:bouncer 作者: hypothesis 项目源码 文件源码
def test_it_rejects_invalid_or_missing_urls(self):
        invalid_urls = [None,

                        # Unsupported protocols.
                        'ftp://foo.bar',
                        'doi:10.1.2/345',
                        'file://foo.bar',

                        # Malformed URLs.
                        'http://goo\[g']

        for url in invalid_urls:
            request = mock_request()
            request.GET['url'] = url

            with pytest.raises(httpexceptions.HTTPBadRequest):
                views.goto_url(request)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号