本文整理汇总了Python中linkcheck.models.Url.check方法的典型用法代码示例。如果您正苦于以下问题:Python Url.check方法的具体用法?Python Url.check怎么用?Python Url.check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类linkcheck.models.Url
的用法示例。
在下文中一共展示了Url.check方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_internal_check_invalid_url
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_internal_check_invalid_url(self):
uv = Url(url="invalid/url", still_exists=True)
uv.check()
self.assertEquals(uv.status, False)
self.assertEquals(uv.message, 'Invalid URL')
示例2: test_internal_check_admin_found
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_internal_check_admin_found(self):
uv = Url(url="/admin/", still_exists=True)
uv.check()
self.assertEquals(uv.status, True)
self.assertEquals(uv.message, 'Working internal link')
示例3: test_internal_check_broken_internal_link
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_internal_check_broken_internal_link(self):
uv = Url(url="/broken/internal/link", still_exists=True)
uv.check()
self.assertEquals(uv.status, False)
self.assertEquals(uv.message, 'Broken internal link')
示例4: test_internal_check_blank
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_internal_check_blank(self):
uv = Url(url="", still_exists=True)
uv.check()
self.assertEquals(uv.status, False)
self.assertEquals(uv.message, 'Empty link')
示例5: test_internal_check_anchor
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_internal_check_anchor(self):
uv = Url(url="#some_anchor", still_exists=True)
uv.check()
self.assertEquals(uv.status, None)
self.assertEquals(uv.message, 'Link to within the same page (not automatically checked)')
示例6: test_external_check_404
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_external_check_404(self):
uv = Url(url="http://qa-dev.w3.org/link-testsuite/http.php?code=404", still_exists=True)
uv.check()
self.assertEquals(uv.status, False)
self.assertEquals(uv.message, '404 Not Found')
示例7: test_internal_check_mailto
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_internal_check_mailto(self):
uv = Url(url="mailto:nobody", still_exists=True)
uv.check()
self.assertEquals(uv.status, None)
self.assertEquals(uv.message, 'Email link (not automatically checked)')
示例8: test_external_check_301
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_external_check_301(self):
uv = Url(url="http://qa-dev.w3.org/link-testsuite/http.php?code=301", still_exists=True)
uv.check()
self.assertEquals(uv.status, False)
self.assertEquals(uv.message, '301 Moved Permanently')
示例9: test_external_check_200
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_external_check_200(self):
uv = Url(url="http://qa-dev.w3.org/link-testsuite/http.php?code=200", still_exists=True)
uv.check()
self.assertEquals(uv.status, True)
self.assertEquals(uv.message, '200 OK')
示例10: test_internal_check_media_utf8
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_internal_check_media_utf8(self):
uv = Url(url="/media/r%C3%BCckmeldung", still_exists=True)
uv.check()
self.assertEquals(uv.status, True)
self.assertEquals(uv.message, 'Working file link')
示例11: test_internal_check_media_found
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_internal_check_media_found(self):
uv = Url(url="/media/found", still_exists=True)
uv.check()
self.assertEquals(uv.status, True)
self.assertEquals(uv.message, 'Working file link')
示例12: test_internal_check_media_missing
# 需要导入模块: from linkcheck.models import Url [as 别名]
# 或者: from linkcheck.models.Url import check [as 别名]
def test_internal_check_media_missing(self):
uv = Url(url="/media/not_found", still_exists=True)
uv.check()
self.assertEquals(uv.status, False)
self.assertEquals(uv.message, 'Missing Document')