mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-26 17:14:42 +00:00
Merge pull request #484 from cjmayo/issuetests
Tests of img srcset and invalid host name
This commit is contained in:
commit
737c61cd67
4 changed files with 20 additions and 0 deletions
1
tests/checker/data/http_invalid_host.html
Normal file
1
tests/checker/data/http_invalid_host.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<a href="http://localhost]">urllib.parse.urlsplit ValueError</a>
|
||||
12
tests/checker/data/http_invalid_host.html.result
Normal file
12
tests/checker/data/http_invalid_host.html.result
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
url http://localhost:%(port)d/%(datadir)s/http_invalid_host.html
|
||||
cache key http://localhost:%(port)d/%(datadir)s/http_invalid_host.html
|
||||
real url http://localhost:%(port)d/%(datadir)s/http_invalid_host.html
|
||||
valid
|
||||
|
||||
url http://localhost]
|
||||
cache key None
|
||||
real url
|
||||
name urllib.parse.urlsplit ValueError
|
||||
info The URL is outside of the domain filter, checked only syntax.
|
||||
error
|
||||
|
||||
|
|
@ -43,6 +43,7 @@ class TestHttp(HttpServerTest):
|
|||
self.file_test("http_file.html", confargs=confargs)
|
||||
self.file_test("http_utf8.html", confargs=confargs)
|
||||
self.file_test("http.xhtml", confargs=confargs)
|
||||
self.file_test("http_invalid_host.html", confargs=confargs)
|
||||
|
||||
def test_status(self):
|
||||
for status in sorted(self.handler.responses.keys()):
|
||||
|
|
|
|||
|
|
@ -64,6 +64,12 @@ class TestLinkparser(unittest.TestCase):
|
|||
content = '<img srcset="%s 1x">'
|
||||
url = "imagesmall.jpg"
|
||||
self._test_one_link(content % url, url)
|
||||
content = '<img srcset="imagesmall.jpg 1x,">'
|
||||
url = "imagesmall.jpg"
|
||||
self._test_one_link(content, url)
|
||||
content = '<img srcset="data:image/vnd.microsoft.icon,000001000200">'
|
||||
url = "data:image/vnd.microsoft.icon,000001000200"
|
||||
self._test_one_link(content, url)
|
||||
|
||||
def test_itemtype_parsing(self):
|
||||
content = '<div itemtype="%s">'
|
||||
|
|
|
|||
Loading…
Reference in a new issue