test fixes

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1912 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2004-11-03 22:34:20 +00:00
parent 9b28e3b346
commit 4cae7dc7f6
20 changed files with 140 additions and 140 deletions

View file

@ -48,7 +48,7 @@ class TestLogger (linkcheck.logger.Logger):
def new_url (self, url_data):
"""append logger output to self.result"""
if self.has_field('url'):
url = u"url %s" % unicode(repr(url_data.base_url)[1:])
url = u"url %s" % url_data.base_url
if url_data.cached:
url += u" (cached)"
self.result.append(url)

View file

@ -1,9 +1,9 @@
url 'file://%(curdir)s/linkcheck/ftests/data/anchor.html'
url file://%(curdir)s/linkcheck/ftests/data/anchor.html
cache key file://%(curdir)s/linkcheck/ftests/data/anchor.html
real url file://%(curdir)s/linkcheck/ftests/data/anchor.html
valid
url '#myid'
url #myid
cache key file://%(curdir)s/linkcheck/ftests/data/anchor.html#myid
real url file://%(curdir)s/linkcheck/ftests/data/anchor.html
name Bla

View file

@ -1,14 +1,14 @@
url 'file://%(curdir)s/linkcheck/ftests/data/base1.html'
url file://%(curdir)s/linkcheck/ftests/data/base1.html
cache key file://%(curdir)s/linkcheck/ftests/data/base1.html
real url file://%(curdir)s/linkcheck/ftests/data/base1.html
valid
url 'base2.html'
url base2.html
cache key file://%(curdir)s/linkcheck/ftests/data/base2.html
real url file://%(curdir)s/linkcheck/ftests/data/base2.html
valid
url 'base2.html' (cached)
url base2.html (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/base2.html
real url file://%(curdir)s/linkcheck/ftests/data/base2.html
valid

View file

@ -1,9 +1,9 @@
url 'file://%(curdir)s/linkcheck/ftests/data/base2.html'
url file://%(curdir)s/linkcheck/ftests/data/base2.html
cache key file://%(curdir)s/linkcheck/ftests/data/base2.html
real url file://%(curdir)s/linkcheck/ftests/data/base2.html
valid
url 'test.txt'
url test.txt
cache key file://%(curdir)s/linkcheck/ftests/data/base/test.txt
real url file://%(curdir)s/linkcheck/ftests/data/base/test.txt
baseurl file://%(curdir)s/linkcheck/ftests/data/base/

View file

@ -1,9 +1,9 @@
url 'file://%(curdir)s/linkcheck/ftests/data/base3.html'
url file://%(curdir)s/linkcheck/ftests/data/base3.html
cache key file://%(curdir)s/linkcheck/ftests/data/base3.html
real url file://%(curdir)s/linkcheck/ftests/data/base3.html
valid
url 'test.txt'
url test.txt
cache key file://%(curdir)s/linkcheck/ftests/data/base/test.txt
real url file://%(curdir)s/linkcheck/ftests/data/base/test.txt
baseurl file://%(curdir)s/linkcheck/ftests/data/base/

View file

@ -1,4 +1,4 @@
url 'file://%(curdir)s/linkcheck/ftests/data/file.asc'
url file://%(curdir)s/linkcheck/ftests/data/file.asc
cache key file://%(curdir)s/linkcheck/ftests/data/file.asc
real url file://%(curdir)s/linkcheck/ftests/data/file.asc
valid

View file

@ -1,14 +1,14 @@
url 'file://%(curdir)s/linkcheck/ftests/data/file.css'
url file://%(curdir)s/linkcheck/ftests/data/file.css
cache key file://%(curdir)s/linkcheck/ftests/data/file.css
real url file://%(curdir)s/linkcheck/ftests/data/file.css
valid
url 'file.html'
url file.html
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
valid
url 'file.html' (cached)
url file.html (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
valid

View file

@ -1,41 +1,41 @@
url 'file://%(curdir)s/linkcheck/ftests/data/file.html'
url file://%(curdir)s/linkcheck/ftests/data/file.html
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
valid
url 'file.html' (cached)
url file.html (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
name relative url
valid
url 'file.html#isnix' (cached)
url file.html#isnix (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
name bad anchor
warning anchor #isnix not found
valid
url 'file.html#iswas' (cached)
url file.html#iswas (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
name good anchor
valid
url '#isnix' (cached)
url #isnix (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
name bad anchor
warning anchor #isnix not found
valid
url '#iswas' (cached)
url #iswas (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
name good anchor
valid
url 'javascript:loadthis()'
url javascript:loadthis()
cache key javascript:loadthis()
real url javascript:loadthis()
name javascript url

View file

@ -1,4 +1,4 @@
url 'file://%(curdir)s/linkcheck/ftests/data/file.txt'
url file://%(curdir)s/linkcheck/ftests/data/file.txt
cache key file://%(curdir)s/linkcheck/ftests/data/file.txt
real url file://%(curdir)s/linkcheck/ftests/data/file.txt
valid

View file

@ -1,14 +1,14 @@
url 'file://%(curdir)s/linkcheck/ftests/data/frames.html'
url file://%(curdir)s/linkcheck/ftests/data/frames.html
cache key file://%(curdir)s/linkcheck/ftests/data/frames.html
real url file://%(curdir)s/linkcheck/ftests/data/frames.html
valid
url 'frames.html' (cached)
url frames.html (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/frames.html
real url file://%(curdir)s/linkcheck/ftests/data/frames.html
valid
url 'frames.html' (cached)
url frames.html (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/frames.html
real url file://%(curdir)s/linkcheck/ftests/data/frames.html
valid

View file

@ -1,129 +1,129 @@
url 'http://localhost:8001/linkcheck/ftests/data/http.html'
url http://localhost:8001/linkcheck/ftests/data/http.html
cache key http://localhost:8001/linkcheck/ftests/data/http.html
real url http://localhost:8001/linkcheck/ftests/data/http.html
valid
url 'http://www.garantiertnixgutt.bla/'
url http://www.garantiertnixgutt.bla/
cache key http://www.garantiertnixgutt.bla/
real url http://www.garantiertnixgutt.bla/
name bad url
error
url 'http://localhost:8001/'
url http://localhost:8001/
cache key http://localhost:8001/
real url http://localhost:8001/
name ok
valid
url 'http:/localhost:8001/'
url http:/localhost:8001/
cache key http:///localhost%%3A8001/
real url http:///localhost%%3A8001/
name one slash
warning Base URL is not properly normed. Normed url is 'http:///localhost%%3A8001/'.
error
url 'http:localhost:8001/' (cached)
url http:localhost:8001/ (cached)
cache key http:///localhost%%3A8001/
real url http:///localhost%%3A8001/
name no slash
warning Base URL is not properly normed. Normed url is 'http:///localhost%%3A8001/'.
error
url 'http://'
url http://
cache key http:///
real url http:///
name no url
warning Base URL is not properly normed. Normed url is 'http:///'.
error
url 'http:/' (cached)
url http:/ (cached)
cache key http:///
real url http:///
name no url, one slash
warning Base URL is not properly normed. Normed url is 'http:///'.
error
url 'http:' (cached)
url http: (cached)
cache key http:///
real url http:///
name no url, no slash
warning Base URL is not properly normed. Normed url is 'http:///'.
error
url 'http://localhost:8001/stalter&sohn'
url http://localhost:8001/stalter&sohn
cache key http://localhost:8001/stalter%%26sohn
real url http://localhost:8001/stalter%%26sohn
name unquoted ampersand
warning Base URL is not properly normed. Normed url is 'http://localhost:8001/stalter%%26sohn'.
error
url 'http://slashdot.org/'
url http://slashdot.org/
cache key http://slashdot.org/
real url http://slashdot.org/
name unquoted
valid
url 'HtTP://LoCAlHOst:8001/' (cached)
url HtTP://LoCAlHOst:8001/ (cached)
cache key http://localhost:8001/
real url http://localhost:8001/
name should be cached
warning Base URL is not properly normed. Normed url is 'http://localhost:8001/'.
valid
url 'HTTP://LOCALHOST:8001/' (cached)
url HTTP://LOCALHOST:8001/ (cached)
cache key http://localhost:8001/
real url http://localhost:8001/
name should be cached
warning Base URL is not properly normed. Normed url is 'http://localhost:8001/'.
valid
url 'http://localhost:8001/?d=directory&p=page'
url http://localhost:8001/?d=directory&p=page
cache key http://localhost:8001/?d=directory&p=page
real url http://localhost:8001/?d=directory&p=page
name should not be cached
valid
url 'http://localhost:8001/?d=directory&p=page1'
url http://localhost:8001/?d=directory&p=page1
cache key http://localhost:8001/?d=directory&p=page1
real url http://localhost:8001/?d=directory&p=page1
name should not be cached
valid
url 'http://localhost:8001/?quoted=\xfc'
url http://localhost:8001/?quoted=\xfc
cache key http://localhost:8001/?quoted=%%FC
real url http://localhost:8001/?quoted=%%FC
name html entities
warning Base URL is not properly normed. Normed url is 'http://localhost:8001/?quoted=%%FC'.
valid
url 'http://localhost:8001/' (cached)
url http://localhost:8001/ (cached)
cache key http://localhost:8001/
real url http://localhost:8001/
valid
url 'http.html' (cached)
url http.html (cached)
cache key http://localhost:8001/linkcheck/ftests/data/http.html
real url http://localhost:8001/linkcheck/ftests/data/http.html
valid
url 'http.html' (cached)
url http.html (cached)
cache key http://localhost:8001/linkcheck/ftests/data/http.html
real url http://localhost:8001/linkcheck/ftests/data/http.html
valid
url 'http.html' (cached)
url http.html (cached)
cache key http://localhost:8001/linkcheck/ftests/data/http.html
real url http://localhost:8001/linkcheck/ftests/data/http.html
name CSS urls
valid
url 'http.html' (cached)
url http.html (cached)
cache key http://localhost:8001/linkcheck/ftests/data/http.html
real url http://localhost:8001/linkcheck/ftests/data/http.html
name CSS urls
valid
url 'http://localhost:8001/' (cached)
url http://localhost:8001/ (cached)
cache key http://localhost:8001/
real url http://localhost:8001/
name no beginning quote

View file

@ -1,4 +1,4 @@
url 'file://%(curdir)s/linkcheck/ftests/data/norobots.html'
url file://%(curdir)s/linkcheck/ftests/data/norobots.html
cache key file://%(curdir)s/linkcheck/ftests/data/norobots.html
real url file://%(curdir)s/linkcheck/ftests/data/norobots.html
valid

View file

@ -1,25 +1,25 @@
url 'file://%(curdir)s/linkcheck/ftests/data/urllist.txt'
url file://%(curdir)s/linkcheck/ftests/data/urllist.txt
cache key file://%(curdir)s/linkcheck/ftests/data/urllist.txt
real url file://%(curdir)s/linkcheck/ftests/data/urllist.txt
valid
url 'file.html'
url file.html
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
valid
url 'file.html#isnix' (cached)
url file.html#isnix (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
warning anchor #isnix not found
valid
url 'file.html#iswas' (cached)
url file.html#iswas (cached)
cache key file://%(curdir)s/linkcheck/ftests/data/file.html
real url file://%(curdir)s/linkcheck/ftests/data/file.html
valid
url 'javascript:loadthis()'
url javascript:loadthis()
cache key javascript:loadthis()
real url javascript:loadthis()
warning Javascript url ignored

View file

@ -27,10 +27,10 @@ class TestError (linkcheck.ftests.StandardTest):
def test_unrecognized (self):
"""unrecognized scheme test"""
url = "hutzli:"
url = u"hutzli:"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key None",
"real url %s" % nurl,
"error",
@ -39,19 +39,19 @@ class TestError (linkcheck.ftests.StandardTest):
def test_leading_whitespace (self):
"""leading whitespace test"""
url = " http://www.heise.de/"
url = u" http://www.heise.de/"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key None",
"real url %s" % nurl,
"error",
]
self.direct(url, resultlines)
url = "\nhttp://www.heise.de/"
url = u"\nhttp://www.heise.de/"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key None",
"real url %s" % nurl,
"error",
@ -60,23 +60,23 @@ class TestError (linkcheck.ftests.StandardTest):
def test_trailing_whitespace (self):
"""trailing whitespace test"""
url = "http://www.heise.de/ "
url = u"http://www.heise.de/ "
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % nurl,
"real url %s" % nurl,
"warning Base URL is not properly normed. Normed url is %r." % nurl,
"warning Base URL is not properly normed. Normed url is %s." % nurl,
"error",
]
self.direct(url, resultlines)
url = "http://www.heise.de/\n"
url = u"http://www.heise.de/\n"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % nurl,
"real url %s" % nurl,
"warning Base URL is not properly normed. Normed url is %r." % nurl,
"warning Base URL is not properly normed. Normed url is %s." % nurl,
"error",
]
self.direct(url, resultlines)
@ -84,30 +84,30 @@ class TestError (linkcheck.ftests.StandardTest):
def test_invalid (self):
"""invalid syntax test"""
# invalid scheme chars
url = "äöü?:"
url = u"äöü?:"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key None",
"real url %s" % nurl,
"error",
]
self.direct(url, resultlines)
# missing scheme alltogether
url = "?äöü?"
url = u"?äöü?"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key None",
"real url %s" % nurl,
"error",
]
self.direct(url, resultlines)
# really fucked up
url = "@³²¼][½ ³@] ¬½"
url = u"@³²¼][½ ³@] ¬½"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key None",
"real url %s" % nurl,
"error",

View file

@ -51,38 +51,38 @@ class TestFile (linkcheck.ftests.StandardTest):
'datadir': 'linkcheck/ftests/data',
}
# good file
url = "file://%(curdir)s/%(datadir)s/file.txt" % attrs
url = u"file://%(curdir)s/%(datadir)s/file.txt" % attrs
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"valid",
]
self.direct(url, resultlines)
# bad file
url = "file:/%(curdir)s/%(datadir)s/file.txt" % attrs
url = u"file:/%(curdir)s/%(datadir)s/file.txt" % attrs
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"error",
]
self.direct(url, resultlines)
# good file (missing double slash)
url = "file:%(curdir)s/%(datadir)s/file.txt" % attrs
url = u"file:%(curdir)s/%(datadir)s/file.txt" % attrs
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key file://%(curdir)s/%(datadir)s/file.txt" % attrs,
"real url file://%(curdir)s/%(datadir)s/file.txt" % attrs,
"warning Base URL is not properly normed. Normed url is %r." % nurl,
"warning Base URL is not properly normed. Normed url is %s." % nurl,
"valid",
]
self.direct(url, resultlines)
# good dir
url = "file://%(curdir)s/%(datadir)s/" % attrs
url = u"file://%(curdir)s/%(datadir)s/" % attrs
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"valid",

View file

@ -29,9 +29,9 @@ class TestFtp (linkcheck.ftests.StandardTest):
def test_ftp (self):
"""test ftp link"""
# ftp two slashes
url = "ftp://ftp.debian.org/"
url = u"ftp://ftp.debian.org/"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"valid",
@ -41,32 +41,32 @@ class TestFtp (linkcheck.ftests.StandardTest):
def test_ftp_slashes (self):
"""test ftp links with missing slashes"""
# ftp one slash
url = "ftp:/ftp.debian.org/"
url = u"ftp:/ftp.debian.org/"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % nurl,
"real url %s" % nurl,
"warning Base URL is not properly normed. Normed url is %r." % nurl,
"warning Base URL is not properly normed. Normed url is %s." % nurl,
"error",
]
self.direct(url, resultlines)
# missing path
url = "ftp://ftp.debian.org"
url = u"ftp://ftp.debian.org"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % nurl,
"real url %s" % nurl,
"warning Base URL is not properly normed. Normed url is %r." % nurl,
"warning Base URL is not properly normed. Normed url is %s." % nurl,
"valid",
]
self.direct(url, resultlines)
# missing trailing dir slash
url = "ftp://ftp.debian.org/debian"
url = u"ftp://ftp.debian.org/debian"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % nurl,
"real url %s/" % nurl,
"warning Missing trailing directory slash in ftp url",
@ -77,31 +77,31 @@ class TestFtp (linkcheck.ftests.StandardTest):
def test_ftp_many_slashes (self):
"""test ftp links with too many slashes"""
# ftp two dir slashes
url = "ftp://ftp.debian.org//debian/"
url = u"ftp://ftp.debian.org//debian/"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % nurl,
"real url %s" % nurl,
"warning Base URL is not properly normed. Normed url is %r." % nurl,
"warning Base URL is not properly normed. Normed url is %s." % nurl,
"valid",
]
self.direct(url, resultlines)
# ftp many dir slashes
url = "ftp://ftp.debian.org////////debian/"
url = u"ftp://ftp.debian.org////////debian/"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % nurl,
"real url %s" % nurl,
"warning Base URL is not properly normed. Normed url is %r." % nurl,
"warning Base URL is not properly normed. Normed url is %s." % nurl,
"valid",
]
self.direct(url, resultlines)
# ftp three slashes
url = "ftp:///ftp.debian.org/"
url = u"ftp:///ftp.debian.org/"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"error",

View file

@ -29,7 +29,7 @@ class TestHttps (linkcheck.ftests.StandardTest):
"""test some https links"""
url = "https://sourceforge.net/"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"valid",

View file

@ -30,7 +30,7 @@ class TestMail (linkcheck.ftests.StandardTest):
url = self.quote("mailto:Dude <calvin@users.sf.net> , "\
"Killer <calvin@users.sourceforge.net>?subject=bla")
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key mailto:calvin@users.sf.net,calvin@users.sourceforge.net",
"real url %s" % url,
"info Verified address: <calvin> is deliverable",
@ -40,7 +40,7 @@ class TestMail (linkcheck.ftests.StandardTest):
url = self.quote("mailto:Bastian Kleineidam <calvin@users.sf.net>?"\
"bcc=calvin%40users.sourceforge.net")
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key mailto:calvin@users.sf.net,calvin@users.sourceforge.net",
"real url %s" % url,
"info Verified address: <calvin> is deliverable",
@ -49,7 +49,7 @@ class TestMail (linkcheck.ftests.StandardTest):
self.direct(url, resultlines)
url = self.quote("mailto:Bastian Kleineidam <calvin@users.sf.net>")
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key mailto:calvin@users.sf.net",
"real url %s" % url,
"info Verified address: <calvin> is deliverable",
@ -58,7 +58,7 @@ class TestMail (linkcheck.ftests.StandardTest):
self.direct(url, resultlines)
url = self.quote("mailto:o'hara@users.sf.net")
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key mailto:o'hara@users.sf.net",
"real url %s" % url,
"info Verified address: <o'hara> is deliverable",
@ -68,7 +68,7 @@ class TestMail (linkcheck.ftests.StandardTest):
url = self.quote("mailto:?to=calvin@users.sf.net&subject=blubb&"\
"cc=calvin_cc@users.sf.net&CC=calvin_CC@users.sf.net")
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key mailto:calvin@users.sf.net,calvin_CC@users.sf.net,calvin_cc@users.sf.net",
"real url %s" % url,
"info Verified address: <calvin> is deliverable",
@ -81,7 +81,7 @@ class TestMail (linkcheck.ftests.StandardTest):
"Re:%20[fm%20#11093]%20(news-admins)%20Submission%20"\
"report%20-%20Pretty%20CoLoRs")
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key mailto:news-admins@freshmeat.net",
"real url %s" % url,
"valid",
@ -89,7 +89,7 @@ class TestMail (linkcheck.ftests.StandardTest):
self.direct(url, resultlines)
url = self.quote("mailto:foo@foo-bar.de?subject=test")
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key mailto:foo@foo-bar.de",
"real url %s" % url,
"valid",
@ -99,31 +99,31 @@ class TestMail (linkcheck.ftests.StandardTest):
def test_warn_mail (self):
"""test some mailto addrs with warnings"""
# contains non-quoted characters
url = "mailto:calvin@users.sf.net?subject=äöü"
url = u"mailto:calvin@users.sf.net?subject=äöü"
qurl = self.quote(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key mailto:calvin@users.sf.net",
"real url %s" % qurl,
"info Verified address: <calvin> is deliverable",
"warning Base URL is not properly normed. Normed url is %r." % qurl,
"warning Base URL is not properly normed. Normed url is %s." % qurl,
"valid",
]
self.direct(url, resultlines)
url = "mailto:calvin@users.sf.net?subject=Halli hallo"
url = u"mailto:calvin@users.sf.net?subject=Halli hallo"
qurl = self.quote(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key mailto:calvin@users.sf.net",
"real url %s" % qurl,
"info Verified address: <calvin> is deliverable",
"warning Base URL is not properly normed. Normed url is %r." % qurl,
"warning Base URL is not properly normed. Normed url is %s." % qurl,
"valid",
]
self.direct(url, resultlines)
url = self.quote("mailto:")
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"warning No addresses found",
@ -137,7 +137,7 @@ class TestMail (linkcheck.ftests.StandardTest):
url = self.quote("mailto:Bastian Kleineidam "\
"<calvin@users.sf.net?foo=bar>")
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key None",
"real url %s" % url,
"error",

View file

@ -34,9 +34,9 @@ class TestNews (linkcheck.ftests.StandardTest):
def test_news (self):
"""test news: link"""
# news testing
url = "news:comp.os.linux.misc"
url = u"news:comp.os.linux.misc"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"warning No NNTP server specified, skipping this URL",
@ -44,9 +44,9 @@ class TestNews (linkcheck.ftests.StandardTest):
]
self.newstest(url, resultlines)
# no group
url = "news:"
url = u"news:"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"warning No NNTP server specified, skipping this URL",
@ -56,13 +56,13 @@ class TestNews (linkcheck.ftests.StandardTest):
def test_snews (self):
"""test snews: link"""
url = "snews:de.comp.os.unix.linux.misc"
url = u"snews:de.comp.os.unix.linux.misc"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % nurl,
"real url %s" % nurl,
"warning Base URL is not properly normed. Normed url is %r." % nurl,
"warning Base URL is not properly normed. Normed url is %s." % nurl,
"warning No NNTP server specified, skipping this URL",
"valid",
]
@ -70,13 +70,13 @@ class TestNews (linkcheck.ftests.StandardTest):
def test_illegal (self):
# illegal syntax
url = "news:§$%&/´`(§%"
url = u"news:§$%&/´`(§%"
qurl = self.quote(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % qurl,
"real url %s" % qurl,
"warning Base URL is not properly normed. Normed url is %r." % qurl,
"warning Base URL is not properly normed. Normed url is %s." % qurl,
"warning No NNTP server specified, skipping this URL",
"valid",
]
@ -84,9 +84,9 @@ class TestNews (linkcheck.ftests.StandardTest):
def test_nntp (self):
"""nttp scheme with host"""
url = "nntp://news.yaako.com/comp.lang.python"
url = u"nntp://news.yaako.com/comp.lang.python"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"valid",
@ -95,17 +95,17 @@ class TestNews (linkcheck.ftests.StandardTest):
def test_article_span (self):
"""article span"""
url = "nntp://news.yaako.com/comp.lang.python/1-5"
url = u"nntp://news.yaako.com/comp.lang.python/1-5"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"valid",
]
self.newstest(url, resultlines)
url = "news:comp.lang.python/1-5"
url = u"news:comp.lang.python/1-5"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"warning No NNTP server specified, skipping this URL",
@ -115,9 +115,9 @@ class TestNews (linkcheck.ftests.StandardTest):
def test_host_no_group (self):
"""host but no group"""
url = "nntp://news.yaako.com/"
url = u"nntp://news.yaako.com/"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"warning No newsgroup specified in NNTP URL",

View file

@ -25,35 +25,35 @@ class TestTelnet (linkcheck.ftests.StandardTest):
"""test telnet: link checking"""
def test_telnet (self):
url = "telnet:"
url = u"telnet:"
nurl = linkcheck.url.url_norm(url)
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % nurl,
"real url %s" % nurl,
"warning Base URL is not properly normed. Normed url is %r." % nurl,
"warning Base URL is not properly normed. Normed url is %s." % nurl,
"error",
]
self.direct(url, resultlines)
url = "telnet://www.imarealdoofus.com"
url = u"telnet://www.imarealdoofus.com"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"error",
]
self.direct(url, resultlines)
url = "telnet://user@www.imarealdoofus.com"
url = u"telnet://user@www.imarealdoofus.com"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"error",
]
self.direct(url, resultlines)
url = "telnet://user:pass@www.imarealdoofus.com"
url = u"telnet://user:pass@www.imarealdoofus.com"
resultlines = [
"url %r" % url,
"url %s" % url,
"cache key %s" % url,
"real url %s" % url,
"error",