当前位置: 首页>>代码示例>>Python>>正文


Python Url.check方法代码示例

本文整理汇总了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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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)')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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)')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py

示例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')
开发者ID:vishalsodani,项目名称:django-linkcheck,代码行数:7,代码来源:__init__.py


注:本文中的linkcheck.models.Url.check方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。