Remove unused url.url_fix_common_typos()

This commit is contained in:
Chris Mayo 2020-08-18 19:57:46 +01:00
parent 9488e1eb41
commit d58b3ab285
2 changed files with 0 additions and 21 deletions

View file

@ -224,15 +224,6 @@ def url_fix_host(urlparts, encoding):
return is_idn
def url_fix_common_typos(url):
"""Fix common typos in given URL like forgotten colon."""
if url.startswith("http//"):
url = "http://" + url[6:]
elif url.startswith("https//"):
url = "https://" + url[7:]
return url
def url_fix_mailto_urlsplit(urlparts):
"""Split query part of mailto url if found."""
sep = "?"

View file

@ -419,18 +419,6 @@ class TestUrl(unittest.TestCase):
nurl = "%C3%A4%C3%B6%C3%BC?:"
self.urlnormtest(url, nurl)
def test_fixing(self):
# Test url fix method.
url = "http//www.example.org"
nurl = "http://www.example.org"
self.assertEqual(linkcheck.url.url_fix_common_typos(url), nurl)
url = "http//www.example.org"
nurl = "http://www.example.org"
self.assertEqual(linkcheck.url.url_fix_common_typos(url), nurl)
url = "https//www.example.org"
nurl = "https://www.example.org"
self.assertEqual(linkcheck.url.url_fix_common_typos(url), nurl)
def test_valid(self):
# Test url validity functions.
u = "http://www.example.com"