test_links.py 文件源码

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

项目:chihu 作者: yelongyu 项目源码 文件源码
def test_ports():
    """URLs can contain port numbers."""
    tests = (
        ('http://foo.com:8000', ('http://foo.com:8000', '')),
        ('http://foo.com:8000/', ('http://foo.com:8000/', '')),
        ('http://bar.com:xkcd', ('http://bar.com', ':xkcd')),
        ('http://foo.com:81/bar', ('http://foo.com:81/bar', '')),
        ('http://foo.com:', ('http://foo.com', ':')),
    )

    def check(test, output):
        out = '<a href="{0}" rel="nofollow">{0}</a>{1}'
        eq_(out.format(*output),
            linkify(test))

    for test, output in tests:
        yield check, test, output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号