git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1288 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2004-04-03 17:54:45 +00:00
parent 35d6651d4f
commit 3200b3a92d
17 changed files with 53 additions and 59 deletions

View file

@ -39,6 +39,11 @@
Changed: linkcheck/{Http,}UrlData.py
Closes: SF bug 928895
* updated regression tests
Type: feature
Changed: test/test_*.py, Makefile.am
Added: test/run.sh
1.12.1 (release 21.2.2004)
* raise IncompleteRead instead of ValueError on malformed chunked

View file

@ -10,7 +10,7 @@ HTMLDIR=/home/calvin/public_html/linkchecker.sf.net/htdocs
HOST=www.debian.org
#LCOPTS=-ocolored -Ftext -Fhtml -Fgml -Fsql -Fcsv -Fxml -R -t0 -v -s
LCOPTS=-ocolored -Ftext -Fhtml -Fgml -Fsql -Fcsv -Fxml -R -t0 -v -s -r1
TEST=env LANG=C ftp_proxy="" http_proxy="" $(PYTHON) test/regrtest.py
TEST=test/run.sh test/regrtest.py
OFFLINETESTS = test_base test_misc test_file test_frames
ONLINETESTS = test_mail test_http test_https test_news test_ftp test_telnet
DESTDIR=/.

View file

@ -1,19 +1,18 @@
test_base
url file:///home/calvin/projects/linkchecker/test/html/base1.html
url file:///home/calvin/projects/linkchecker/test/html/codebase.html
valid
url test.txt
baseurl file:///home/calvin/projects/linkchecker/test/html/base/
valid
url test.txt
cached
baseurl file:///home/calvin/projects/linkchecker/test/html/base/
valid
url file:///home/calvin/projects/linkchecker/test/html/base2.html
valid
url file:///home/calvin/projects/linkchecker/test/html/codebase.html
url file:///home/calvin/projects/linkchecker/test/html/base1.html
valid
url misc.html
valid
url misc.html
cached
valid
url test.txt
baseurl file:///home/calvin/projects/linkchecker/test/html/base/
valid
url test.txt
cached
baseurl file:///home/calvin/projects/linkchecker/test/html/base/
valid

View file

@ -1,33 +1,32 @@
test_file
url file:///home/calvin/projects/linkchecker/test/html/file.html
url file:///home/calvin/projects/linkchecker/test/html/file.asc
valid
url file:///home/calvin/projects/linkchecker/test/html/file.txt
valid
url file:///home/calvin/projects/linkchecker/test/html/file.asc
url file:///home/calvin/projects/linkchecker/test/html/file.html
valid
url http.html
name relative url
valid
url http.html#isnix
name bad anchor
warning anchor #isnix not found
valid
url http.html#iswas
name good anchor
valid
url file:///etc/group
url file:/etc/
name good dir
error
url file:etc/group
name bad file
error
url file:/etc/group
name good file
valid
url file://etc/group
name bad file
error
url file:/etc/group
cached
url file:///etc/group
name good file
valid
url file:etc/group
name bad file
error
url file:/etc/
name good dir
error
url http.html#iswas
name good anchor
valid
url http.html#isnix
name bad anchor
warning anchor #isnix not found
valid
url http.html
name relative url
valid

View file

@ -1,16 +1,13 @@
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import sys, os
sys.path.insert(0, os.getcwd())
import sys
from linkcheck.parser.htmllib import HtmlPrinter
def _main():
#pass
file = sys.argv[1]
data = open(file).read()
def _main (filename):
data = file(filename).read()
p = HtmlPrinter()
p.feed(data)
p.flush()
if __name__=='__main__':
_main()
_main(sys.argv[1])

View file

@ -31,7 +31,6 @@ If no test names are given, all tests are run.
import sys, getopt, os
sys.path.insert(0, os.getcwd())
from linkcheck import test_support
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,

4
test/run.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
# run python interpreter with current dir as search path, and remove all
# locale settings
env -u LANGUAGE -u LC_ALL -u LC_CTYPE LANG=C PYTHONPATH=`pwd` python $*

View file

@ -7,8 +7,7 @@ config['log'] = config.newLogger('test')
config["anchors"] = True
config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('base1.html', 'base2.html', 'codebase.html'):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)

View file

@ -7,8 +7,7 @@ config['log'] = config.newLogger('test')
config["anchors"] = True
config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('file.html', "file.txt", "file.asc"):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)

View file

@ -7,8 +7,7 @@ config['log'] = config.newLogger('test')
config["anchors"] = True
config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('frames.html',):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)

View file

@ -7,8 +7,7 @@ config['log'] = config.newLogger('test')
config["anchors"] = True
config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('ftp.html',):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)

View file

@ -9,6 +9,6 @@ config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('http.html',):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)

View file

@ -7,8 +7,7 @@ config['log'] = config.newLogger('test')
config["anchors"] = True
config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('https.html',):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)

View file

@ -7,8 +7,7 @@ config['log'] = config.newLogger('test')
config["anchors"] = True
config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('mail.html',):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)

View file

@ -7,8 +7,7 @@ config['log'] = config.newLogger('test')
config["anchors"] = True
config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('misc.html','anchor.html', 'norobots.html'):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)

View file

@ -7,8 +7,7 @@ config['log'] = config.newLogger('test')
config["anchors"] = True
config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('news.html',):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)

View file

@ -7,8 +7,7 @@ config['log'] = config.newLogger('test')
config["anchors"] = True
config["verbose"] = True
config.setThreads(0)
htmldir = "test/html"
for filename in ('telnet.html',):
url = os.path.join(htmldir, filename)
url = os.path.join("test", "html", filename)
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0, config))
linkcheck.checkUrls(config)