mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-10 17:40:58 +00:00
Fix test cases for example.com redirection.
This commit is contained in:
parent
e6ad32c028
commit
a86e36e5d3
8 changed files with 31 additions and 13 deletions
|
|
@ -12,6 +12,7 @@ valid
|
|||
|
||||
url http://www.example.com
|
||||
cache key http://www.example.com
|
||||
real url http://www.iana.org/domains/example/
|
||||
real url http://www.iana.org/domains/example
|
||||
info Redirected to `http://www.iana.org/domains/example/'.
|
||||
info Redirected to `http://www.iana.org/domains/example'.
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ valid
|
|||
|
||||
url http://www.example.com/
|
||||
cache key http://www.example.com/
|
||||
real url http://www.iana.org/domains/example/
|
||||
real url http://www.iana.org/domains/example
|
||||
info Redirected to `http://www.iana.org/domains/example/'.
|
||||
info Redirected to `http://www.iana.org/domains/example'.
|
||||
valid
|
||||
|
||||
url favicon.ico
|
||||
|
|
|
|||
|
|
@ -7,14 +7,16 @@ valid
|
|||
|
||||
url http://www.example.com/
|
||||
cache key http://www.example.com/
|
||||
real url http://www.iana.org/domains/example/
|
||||
real url http://www.iana.org/domains/example
|
||||
name Imadoofus
|
||||
info Redirected to `http://www.iana.org/domains/example/'.
|
||||
info Redirected to `http://www.iana.org/domains/example'.
|
||||
valid
|
||||
|
||||
url http://www.example.net/
|
||||
cache key http://www.example.net/
|
||||
real url http://www.iana.org/domains/example/
|
||||
real url http://www.iana.org/domains/example
|
||||
name Imanotherdoofus
|
||||
info Redirected to `http://www.iana.org/domains/example/'.
|
||||
info Redirected to `http://www.iana.org/domains/example'.
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -9,14 +9,16 @@ valid
|
|||
|
||||
url http://www.example.com/
|
||||
cache key http://www.example.com/
|
||||
real url http://www.iana.org/domains/example/
|
||||
real url http://www.iana.org/domains/example
|
||||
name Imadoofus
|
||||
info Redirected to `http://www.iana.org/domains/example/'.
|
||||
info Redirected to `http://www.iana.org/domains/example'.
|
||||
valid
|
||||
|
||||
url http://www.example.net/
|
||||
cache key http://www.example.net/
|
||||
real url http://www.iana.org/domains/example/
|
||||
real url http://www.iana.org/domains/example
|
||||
name Imanotherdoofus
|
||||
info Redirected to `http://www.iana.org/domains/example/'.
|
||||
info Redirected to `http://www.iana.org/domains/example'.
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -6,8 +6,9 @@ valid
|
|||
|
||||
url redirect_newhost.html
|
||||
cache key http://localhost:%(port)d/%(datadir)s/redirect_newhost.html
|
||||
real url http://www.iana.org/domains/example/
|
||||
real url http://www.iana.org/domains/example
|
||||
name redirect to new host
|
||||
info Redirected to `http://www.example.com/'.
|
||||
info Redirected to `http://www.iana.org/domains/example/'.
|
||||
info Redirected to `http://www.iana.org/domains/example'.
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -39,8 +39,9 @@ class TestHttpMisc (HttpServerTest):
|
|||
u"valid",
|
||||
u"url http://www.example.org/",
|
||||
u"cache key http://www.example.org/",
|
||||
u"real url http://www.iana.org/domains/example/",
|
||||
u"real url http://www.iana.org/domains/example",
|
||||
u"info Redirected to `http://www.iana.org/domains/example/'.",
|
||||
u"info Redirected to `http://www.iana.org/domains/example'.",
|
||||
u"valid",
|
||||
]
|
||||
self.direct(url, resultlines, recursionlevel=1)
|
||||
|
|
|
|||
|
|
@ -29,11 +29,13 @@ class TestURLLength(LinkCheckTest):
|
|||
url = u"http://www.example.org/%s" % (u"a" * 256)
|
||||
attrs = self.get_attrs(url=url)
|
||||
attrs['nurl'] = u"http://www.iana.org/domains/example/"
|
||||
attrs['rurl'] = u"http://www.iana.org/domains/example"
|
||||
resultlines = [
|
||||
u"url %(url)s" % attrs,
|
||||
u"cache key %(url)s" % attrs,
|
||||
u"real url %(nurl)s" % attrs,
|
||||
u"real url %(rurl)s" % attrs,
|
||||
u"info Redirected to `%(nurl)s'." % attrs,
|
||||
u"info Redirected to `%(rurl)s'." % attrs,
|
||||
u"warning URL length 279 is longer than 255.",
|
||||
u"valid",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -30,12 +30,14 @@ class TestWhitespace (LinkCheckTest):
|
|||
url = u" http://www.example.org/"
|
||||
attrs = self.get_attrs(url=url)
|
||||
attrs['nurl'] = "http://www.iana.org/domains/example/"
|
||||
attrs['rurl'] = "http://www.iana.org/domains/example"
|
||||
attrs['surl'] = url.strip()
|
||||
resultlines = [
|
||||
u"url %(surl)s" % attrs,
|
||||
u"cache key %(surl)s" % attrs,
|
||||
u"real url %(nurl)s" % attrs,
|
||||
u"real url %(rurl)s" % attrs,
|
||||
u"info Redirected to `%(nurl)s'." % attrs,
|
||||
u"info Redirected to `%(rurl)s'." % attrs,
|
||||
u"warning Leading or trailing whitespace in URL `%(url)s'." % attrs,
|
||||
u"valid",
|
||||
]
|
||||
|
|
@ -43,12 +45,14 @@ class TestWhitespace (LinkCheckTest):
|
|||
url = u"\nhttp://www.example.org/"
|
||||
attrs = self.get_attrs(url=url)
|
||||
attrs['nurl'] = "http://www.iana.org/domains/example/"
|
||||
attrs['rurl'] = "http://www.iana.org/domains/example"
|
||||
attrs['surl'] = url.strip()
|
||||
resultlines = [
|
||||
u"url %(surl)s" % attrs,
|
||||
u"cache key %(surl)s" % attrs,
|
||||
u"real url %(nurl)s" % attrs,
|
||||
u"real url %(rurl)s" % attrs,
|
||||
u"info Redirected to `%(nurl)s'." % attrs,
|
||||
u"info Redirected to `%(rurl)s'." % attrs,
|
||||
u"warning Leading or trailing whitespace in URL `%(url)s'." % attrs,
|
||||
u"valid",
|
||||
]
|
||||
|
|
@ -58,22 +62,26 @@ class TestWhitespace (LinkCheckTest):
|
|||
# Trailing whitespace
|
||||
url = u"http://www.example.org/ "
|
||||
nurl = "http://www.iana.org/domains/example/"
|
||||
rurl = "http://www.iana.org/domains/example"
|
||||
resultlines = [
|
||||
u"url %s" % url.strip(),
|
||||
u"cache key %s" % url.strip(),
|
||||
u"real url %s" % nurl,
|
||||
u"real url %s" % rurl,
|
||||
u"info Redirected to `%s'." % nurl,
|
||||
u"info Redirected to `%s'." % rurl,
|
||||
u"warning Leading or trailing whitespace in URL `%s'." % url,
|
||||
u"valid",
|
||||
]
|
||||
self.direct(url, resultlines)
|
||||
url = u"http://www.example.org/\n"
|
||||
nurl = "http://www.iana.org/domains/example/"
|
||||
rurl = "http://www.iana.org/domains/example"
|
||||
resultlines = [
|
||||
u"url %s" % url.strip(),
|
||||
u"cache key %s" % url.strip(),
|
||||
u"real url %s" % nurl,
|
||||
u"real url %s" % rurl,
|
||||
u"info Redirected to `%s'." % nurl,
|
||||
u"info Redirected to `%s'." % rurl,
|
||||
u"warning Leading or trailing whitespace in URL `%s'." % url,
|
||||
u"valid",
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue