mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-10 07:34:44 +00:00
added tests for UnicodeError 'label too long'
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3270 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
7e1e01bd36
commit
3142663135
3 changed files with 14 additions and 2 deletions
|
|
@ -3,5 +3,8 @@
|
|||
<meta rel="SHORTCUT ICON" href="favicon.ico">
|
||||
<meta rel="ICON" href="favicon.ico">
|
||||
|
||||
<!-- unparsable domain name -->
|
||||
<a href="http://imadoofus.org%0D%3Cfont%20face=%22Verdana,%20Arial,%20Helvetica,%20sans-serif%22%20size=%222%22%3E%3Chttp://www.imadoofus.org%3E%20%0D%20%20%20%20%20%20%20%20%20%20%20%20%20%20">blubb</a>
|
||||
|
||||
<!-- empty tag -->
|
||||
<tr background>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,12 @@ cache key file://%(curdir)s/%(datadir)s/favicon.ico
|
|||
real url file://%(curdir)s/%(datadir)s/favicon.ico
|
||||
valid
|
||||
|
||||
url http://imadoofus.org%0D%3Cfont%20face=%22Verdana,%20Arial,%20Helvetica,%20sans-serif%22%20size=%222%22%3E%3Chttp://www.imadoofus.org%3E%20%0D%20%20%20%20%20%20%20%20%20%20%20%20%20%20
|
||||
cache key None
|
||||
real url None
|
||||
name blubb
|
||||
error
|
||||
|
||||
url
|
||||
cache key None
|
||||
real url None
|
||||
|
|
|
|||
|
|
@ -495,12 +495,15 @@ class TestUrl (unittest.TestCase):
|
|||
Test idna encoding.
|
||||
"""
|
||||
url = u'www.öko.de'
|
||||
encurl, is_idn = linkcheck.url.idna_encode(url)
|
||||
idna_encode =linkcheck.url.idna_encode
|
||||
encurl, is_idn = idna_encode(url)
|
||||
self.assert_(is_idn)
|
||||
url = u''
|
||||
encurl, is_idn = linkcheck.url.idna_encode(url)
|
||||
encurl, is_idn = idna_encode(url)
|
||||
self.assert_(not is_idn)
|
||||
self.assert_(not encurl)
|
||||
url = u"http://www.imadoofus.org%0D%3Cfont%20face=%22Verdana,%20Arial,%20Helvetica,%20sans-serif%22%20size=%222%22%3E%3Chttp://www.imadoofus.org%3E%20%0D%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
|
||||
self.assertRaises(UnicodeError, idna_encode, url)
|
||||
|
||||
def test_match_host (self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue