Merge pull request #484 from cjmayo/issuetests

Tests of img srcset and invalid host name
This commit is contained in:
Chris Mayo 2020-08-22 16:32:03 +01:00 committed by GitHub
commit 737c61cd67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1 @@
<a href="http://localhost]">urllib.parse.urlsplit ValueError</a>

View 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

View file

@ -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()):

View file

@ -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">'