mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-05 21:24:45 +00:00
add real url to test result
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1449 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
3f300f38e1
commit
d1c432f146
16 changed files with 100 additions and 23 deletions
|
|
@ -1,5 +1,7 @@
|
|||
url file://%(curdir)s/linkcheck/ftests/data/anchor.html
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/anchor.html
|
||||
valid
|
||||
url #myid
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/anchor.html
|
||||
name Bla
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
url file://%(curdir)s/linkcheck/ftests/data/base1.html
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/base1.html
|
||||
valid
|
||||
url base2.html
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/base2.html
|
||||
valid
|
||||
url base2.html (cached)
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/base2.html
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
url file://%(curdir)s/linkcheck/ftests/data/base2.html
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/base2.html
|
||||
valid
|
||||
url test.txt
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/base/test.txt
|
||||
baseurl file://%(curdir)s/linkcheck/ftests/data/base/
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
url file://%(curdir)s/linkcheck/ftests/data/base3.html
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/base3.html
|
||||
valid
|
||||
url test.txt
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/base/test.txt
|
||||
baseurl file://%(curdir)s/linkcheck/ftests/data/base/
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
url file://%(curdir)s/linkcheck/ftests/data/file.asc
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.asc
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
url file://%(curdir)s/linkcheck/ftests/data/file.css
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.css
|
||||
valid
|
||||
url file.html
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.html
|
||||
valid
|
||||
url file.html (cached)
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.html
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -1,26 +1,34 @@
|
|||
url file://%(curdir)s/linkcheck/ftests/data/file.html
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.html
|
||||
valid
|
||||
url file.html (cached)
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.html
|
||||
name relative url
|
||||
valid
|
||||
url file.html#isnix
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.html
|
||||
name bad anchor
|
||||
warning anchor #isnix not found
|
||||
valid
|
||||
url file.html#iswas
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.html
|
||||
name good anchor
|
||||
valid
|
||||
url #isnix (cached)
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.html
|
||||
name bad anchor
|
||||
warning anchor #isnix not found
|
||||
valid
|
||||
url #iswas (cached)
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.html
|
||||
name good anchor
|
||||
valid
|
||||
url hutzli:nixgutt
|
||||
real url hutzli:nixgutt
|
||||
name bad scheme
|
||||
error
|
||||
url javascript:loadthis()
|
||||
real url javascript:loadthis()
|
||||
name javascript url
|
||||
warning Javascript url ignored
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
url file://%(curdir)s/linkcheck/ftests/data/file.txt
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/file.txt
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
url file://%(curdir)s/linkcheck/ftests/data/frames.html
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/frames.html
|
||||
valid
|
||||
url frames.html (cached)
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/frames.html
|
||||
valid
|
||||
url frames.html (cached)
|
||||
real url file://%(curdir)s/linkcheck/ftests/data/frames.html
|
||||
valid
|
||||
|
|
|
|||
|
|
@ -1,57 +1,76 @@
|
|||
url http://localhost:8001/linkcheck/ftests/data/http.html
|
||||
real url http://localhost:8001/linkcheck/ftests/data/http.html
|
||||
valid
|
||||
url http://www.garantiertnixgutt.bla/
|
||||
real url http://www.garantiertnixgutt.bla/
|
||||
name bad url
|
||||
error
|
||||
url http://localhost:8000/
|
||||
real url http://localhost:8000/
|
||||
name ok
|
||||
error
|
||||
url http:/localhost:8000/
|
||||
real url http://localhost:8001/localhost:8000/
|
||||
name one slash
|
||||
error
|
||||
url http:localhost:8000/
|
||||
real url http://localhost:8001/linkcheck/ftests/data/localhost:8000/
|
||||
name no slash
|
||||
error
|
||||
url http:// (cached)
|
||||
real url http://
|
||||
name no url
|
||||
warning URL path is empty, assuming '/' as path
|
||||
error
|
||||
url http:/
|
||||
real url http:/
|
||||
name no url, one slash
|
||||
warning URL path is empty, assuming '/' as path
|
||||
error
|
||||
url http: (cached)
|
||||
real url http:
|
||||
name no url, no slash
|
||||
warning URL path is empty, assuming '/' as path
|
||||
error
|
||||
url http://localhost:8000/stalter&sohn
|
||||
real url http://localhost:8000/stalter&sohn
|
||||
name unquoted ampersand
|
||||
error
|
||||
url http://slashdot.org/
|
||||
real url http://slashdot.org/
|
||||
name unquoted
|
||||
valid
|
||||
url HtTP://LoCAlHOst:8000/ (cached)
|
||||
real url http://localhost:8000/
|
||||
name should be cached
|
||||
error
|
||||
url HTTP://LOCALHOST:8000/ (cached)
|
||||
real url http://localhost:8000/
|
||||
name should be cached
|
||||
error
|
||||
url http://localhost:8000/?quoted=%%FC
|
||||
real url http://localhost:8000/?quoted=%%FC
|
||||
name html entities
|
||||
warning Base URL is not properly quoted
|
||||
error
|
||||
url http://localhost:8000/ (cached)
|
||||
real url http://localhost:8000/
|
||||
error
|
||||
url http.html (cached)
|
||||
real url http://localhost:8001/linkcheck/ftests/data/http.html
|
||||
valid
|
||||
url http.html (cached)
|
||||
real url http://localhost:8001/linkcheck/ftests/data/http.html
|
||||
valid
|
||||
url http.html (cached)
|
||||
real url http://localhost:8001/linkcheck/ftests/data/http.html
|
||||
name CSS urls
|
||||
valid
|
||||
url http.html (cached)
|
||||
real url http://localhost:8001/linkcheck/ftests/data/http.html
|
||||
name CSS urls
|
||||
valid
|
||||
url http://localhost:8000/ (cached)
|
||||
real url http://localhost:8000/
|
||||
name no beginning quote
|
||||
error
|
||||
|
|
|
|||
|
|
@ -48,19 +48,23 @@ class TestFile (linkcheck.ftests.StandardTest):
|
|||
}
|
||||
# good file
|
||||
url = "file://%(curdir)s/%(datadir)s/file.txt" % attrs
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.direct(url, resultlines)
|
||||
# bad file
|
||||
url = "file:/%(curdir)s/%(datadir)s/file.txt" % attrs
|
||||
resultlines = ["url %s" % url, "error"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "error"]
|
||||
self.direct(url, resultlines)
|
||||
# good file
|
||||
# good file (missing double slash)
|
||||
url = "file:%(curdir)s/%(datadir)s/file.txt" % attrs
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url file://%(curdir)s/%(datadir)s/file.txt" % attrs ,
|
||||
"valid",
|
||||
]
|
||||
self.direct(url, resultlines)
|
||||
# good dir
|
||||
url = "file://%(curdir)s/%(datadir)s/" % attrs
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.direct(url, resultlines)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,35 +24,38 @@ import linkcheck.ftests
|
|||
class TestFtp (linkcheck.ftests.StandardTest):
|
||||
"""test ftp: link checking"""
|
||||
|
||||
needed_resources = ['network']
|
||||
|
||||
def test_ftp (self):
|
||||
"""test some ftp links"""
|
||||
# ftp one slash
|
||||
url = "ftp:/ftp.debian.org/"
|
||||
resultlines = ["url %s" % url, "error"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "error"]
|
||||
self.direct(url, resultlines)
|
||||
# ftp two slashes
|
||||
url = "ftp://ftp.debian.org/"
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.direct(url, resultlines)
|
||||
# ftp two dir slashes
|
||||
url = "ftp://ftp.debian.org//debian/"
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.direct(url, resultlines)
|
||||
# missing trailing dir slash
|
||||
url = "ftp://ftp.debian.org/debian"
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % url,
|
||||
"warning Missing trailing directory slash in ftp url",
|
||||
"valid",
|
||||
]
|
||||
self.direct(url, resultlines)
|
||||
# ftp many dir slashes
|
||||
url = "ftp://ftp.debian.org////////debian/"
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.direct(url, resultlines)
|
||||
# ftp three slashes
|
||||
url = "ftp:///ftp.debian.org/"
|
||||
resultlines = ["url %s" % url, "error"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "error"]
|
||||
self.direct(url, resultlines)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,12 @@ import linkcheck.ftests
|
|||
class TestHttps (linkcheck.ftests.StandardTest):
|
||||
"""test https: link checking"""
|
||||
|
||||
def test_mail (self):
|
||||
needed_resources = ['network']
|
||||
|
||||
def test_https (self):
|
||||
"""test some https links"""
|
||||
url = "https://sourceforge.net/"
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.direct(url, resultlines)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,15 @@ import linkcheck.ftests
|
|||
class TestMail (linkcheck.ftests.StandardTest):
|
||||
"""test mailto: link checking"""
|
||||
|
||||
needed_resources = ['network']
|
||||
|
||||
def test_good_mail (self):
|
||||
"""test some good mailto addrs"""
|
||||
url = self.quote("mailto:Dude <calvin@users.sf.net> , "\
|
||||
"Killer <calvin@users.sourceforge.net>?subject=bla")
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % url,
|
||||
"info Verified address: <calvin> is deliverable",
|
||||
"valid",
|
||||
]
|
||||
|
|
@ -37,6 +40,7 @@ class TestMail (linkcheck.ftests.StandardTest):
|
|||
"bcc=calvin%40users.sf.net")
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % url,
|
||||
"info Verified address: <calvin> is deliverable",
|
||||
"valid",
|
||||
]
|
||||
|
|
@ -44,6 +48,7 @@ class TestMail (linkcheck.ftests.StandardTest):
|
|||
url = self.quote("mailto:Bastian Kleineidam <calvin@users.sf.net>")
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % url,
|
||||
"info Verified address: <calvin> is deliverable",
|
||||
"valid",
|
||||
]
|
||||
|
|
@ -51,6 +56,7 @@ class TestMail (linkcheck.ftests.StandardTest):
|
|||
url = self.quote("mailto:o'hara@users.sf.net")
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % url,
|
||||
"info Verified address: <o'hara> is deliverable",
|
||||
"valid",
|
||||
]
|
||||
|
|
@ -59,6 +65,7 @@ class TestMail (linkcheck.ftests.StandardTest):
|
|||
"cc=calvin_cc@users.sf.net&CC=calvin_CC@users.sf.net")
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % url,
|
||||
"info Verified address: <calvin> is deliverable",
|
||||
"info Verified address: <calvin_cc> is deliverable",
|
||||
"info Verified address: <calvin_CC> is deliverable",
|
||||
|
|
@ -68,10 +75,10 @@ class TestMail (linkcheck.ftests.StandardTest):
|
|||
url = self.quote("mailto:news-admins@freshmeat.net?subject="\
|
||||
"Re:%20[fm%20#11093]%20(news-admins)%20Submission%20"\
|
||||
"report%20-%20Pretty%20CoLoRs")
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url,"valid"]
|
||||
self.direct(url, resultlines)
|
||||
url = self.quote("mailto:"+"foo@foo-bar.de?subject=test")
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url,"valid"]
|
||||
self.direct(url, resultlines)
|
||||
|
||||
def test_warn_mail (self):
|
||||
|
|
@ -80,6 +87,7 @@ class TestMail (linkcheck.ftests.StandardTest):
|
|||
url = "calvin@users.sf.net?subject=äöü"
|
||||
resultlines = [
|
||||
"url %s" % self.quote("mailto:"+url),
|
||||
"real url %s" % self.quote("mailto:"+url),
|
||||
"info Verified address: <calvin> is deliverable",
|
||||
"warning Base URL is not properly quoted",
|
||||
"valid",
|
||||
|
|
@ -88,6 +96,7 @@ class TestMail (linkcheck.ftests.StandardTest):
|
|||
url = "calvin@users.sf.net?subject=Halli hallo"
|
||||
resultlines = [
|
||||
"url %s" % self.quote("mailto:"+url),
|
||||
"real url %s" % self.quote("mailto:"+url),
|
||||
"info Verified address: <calvin> is deliverable",
|
||||
"warning Base URL is not properly quoted",
|
||||
"valid",
|
||||
|
|
@ -96,6 +105,7 @@ class TestMail (linkcheck.ftests.StandardTest):
|
|||
url = self.quote("mailto:")
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % url,
|
||||
"warning No addresses found",
|
||||
"valid",
|
||||
]
|
||||
|
|
@ -106,7 +116,7 @@ class TestMail (linkcheck.ftests.StandardTest):
|
|||
# ? extension forbidden in <> construct
|
||||
url = self.quote("mailto:Bastian Kleineidam "\
|
||||
"<calvin@users.sf.net?foo=bar>")
|
||||
resultlines = ["url %s" % url, "error"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url,"error"]
|
||||
self.direct(url, resultlines)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,16 +24,20 @@ import linkcheck.ftests
|
|||
class TestNews (linkcheck.ftests.StandardTest):
|
||||
"""test nntp: and news: link checking"""
|
||||
|
||||
needed_resources = ['network']
|
||||
|
||||
def newstest (self, url, resultlines):
|
||||
fields = ['url', 'warning', 'result', ]
|
||||
fields = ['url', 'realurl', 'warning', 'result', ]
|
||||
self.direct(url, resultlines, fields=fields)
|
||||
|
||||
def test_news (self):
|
||||
"""test some news links"""
|
||||
# news testing
|
||||
url = "news:comp.os.linux.misc"
|
||||
rurl = "nntp:comp.os.linux.misc"
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % rurl,
|
||||
"warning No NNTP server specified, skipping this URL",
|
||||
"valid",
|
||||
]
|
||||
|
|
@ -42,22 +46,27 @@ class TestNews (linkcheck.ftests.StandardTest):
|
|||
url = "snews:de.comp.os.unix.linux.misc"
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % url,
|
||||
"warning No NNTP server specified, skipping this URL",
|
||||
"valid",
|
||||
]
|
||||
self.newstest(url, resultlines)
|
||||
# no group
|
||||
url = "news:"
|
||||
rurl = "nntp:"
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % rurl,
|
||||
"warning No NNTP server specified, skipping this URL",
|
||||
"valid",
|
||||
]
|
||||
self.newstest(url, resultlines)
|
||||
# illegal syntax
|
||||
url = "§$%&/´`(§%"
|
||||
qurl = self.quote("news:"+url)
|
||||
resultlines = [
|
||||
"url %s" % self.quote("news:"+url),
|
||||
"url %s" % qurl,
|
||||
"real url %s" % qurl.replace("news:", "nntp:"),
|
||||
"warning Base URL is not properly quoted",
|
||||
"warning No NNTP server specified, skipping this URL",
|
||||
"valid",
|
||||
|
|
@ -65,24 +74,27 @@ class TestNews (linkcheck.ftests.StandardTest):
|
|||
self.newstest("news:"+url, resultlines)
|
||||
# nttp scheme with host
|
||||
url = "nntp://news.yaako.com/comp.lang.python"
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.newstest(url, resultlines)
|
||||
# article span
|
||||
url = "nntp://news.yaako.com/comp.lang.python/1-5"
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.newstest(url, resultlines)
|
||||
# host but no group
|
||||
url = "nntp://news.yaako.com/"
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % url,
|
||||
"warning No newsgroup specified in NNTP URL",
|
||||
"valid",
|
||||
]
|
||||
self.newstest(url, resultlines)
|
||||
# article span
|
||||
url = "news:comp.lang.python/1-5"
|
||||
rurl = "nntp:comp.lang.python/1-5"
|
||||
resultlines = [
|
||||
"url %s" % url,
|
||||
"real url %s" % rurl,
|
||||
"warning No NNTP server specified, skipping this URL",
|
||||
"valid",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -24,18 +24,20 @@ import linkcheck.ftests
|
|||
class TestTelnet (linkcheck.ftests.StandardTest):
|
||||
"""test telnet: link checking"""
|
||||
|
||||
needed_resources = ['network']
|
||||
|
||||
def test_telnet (self):
|
||||
url = "telnet:"
|
||||
resultlines = ["url %s" % url, "error"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "error"]
|
||||
self.direct(url, resultlines)
|
||||
url = "telnet://swindon.city.ac.uk"
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.direct(url, resultlines)
|
||||
url = "telnet://user@swindon.city.ac.uk"
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.direct(url, resultlines)
|
||||
url = "telnet://user:password@swindon.city.ac.uk"
|
||||
resultlines = ["url %s" % url, "valid"]
|
||||
resultlines = ["url %s" % url, "real url %s" % url, "valid"]
|
||||
self.direct(url, resultlines)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue