diff --git a/MANIFEST.in b/MANIFEST.in index ef55b9ef..d4956bae 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -19,6 +19,9 @@ include debian/NEWS include debian/README.Debian include debian/watch include test.py tests/*.py +include tests/checker/*.py +include tests/configuration/*.py +include tests/dns/*.py include scripts/*.py scripts/*.sh scripts/*.bat include cgi-bin/lconline/*.html cgi-bin/lconline/*.de cgi-bin/lconline/*.en include cgi-bin/lconline/*.js cgi-bin/lconline/*.css @@ -36,12 +39,8 @@ include doc/en/*.html doc/en/*.css doc/en/*.1 doc/en/*.5 doc/en/Makefile include doc/de/*.1 doc/de/*.5 include doc/Makefile doc/rest2htmlnav include doc/examples/*.sh -recursive-include linkcheck/checker/tests/data *.txt *.html *.result *.asc *.css *.ico -recursive-include linkcheck/configuration/tests/data *.ini -include linkcheck/tests/*.py -include linkcheck/checker/tests/*.py -include linkcheck/configuration/tests/*.py -include linkcheck/dns/tests/*.py -include linkcheck/dns/tests/example* +recursive-include tests/checker/data *.txt *.html *.result *.asc *.css *.ico +recursive-include tests/configuration/data *.ini +include tests/dns/example* include linkcheck/dns/ChangeLog include hase.bmp diff --git a/linkcheck/checker/tests/data/anchor.html b/linkcheck/checker/tests/data/anchor.html deleted file mode 100644 index c3ef16da..00000000 --- a/linkcheck/checker/tests/data/anchor.html +++ /dev/null @@ -1,8 +0,0 @@ -Bla - diff --git a/linkcheck/checker/tests/data/anchor.html.result b/linkcheck/checker/tests/data/anchor.html.result deleted file mode 100644 index 3813c02a..00000000 --- a/linkcheck/checker/tests/data/anchor.html.result +++ /dev/null @@ -1,36 +0,0 @@ -url file://%(curdir)s/%(datadir)s/anchor.html -cache key file://%(curdir)s/%(datadir)s/anchor.html -real url file://%(curdir)s/%(datadir)s/anchor.html -valid - -url anchor.html (cached) -cache key file://%(curdir)s/%(datadir)s/anchor.html -real url file://%(curdir)s/%(datadir)s/anchor.html -name Bla6 -valid - -url #myid -cache key file://%(curdir)s/%(datadir)s/anchor.html#myid -real url file://%(curdir)s/%(datadir)s/anchor.html -name Bla -valid - -url #myid (cached) -cache key file://%(curdir)s/%(datadir)s/anchor.html#myid -real url file://%(curdir)s/%(datadir)s/anchor.html -name Bla2 -valid - -url #broken -cache key file://%(curdir)s/%(datadir)s/anchor.html#broken -real url file://%(curdir)s/%(datadir)s/anchor.html -name Bla3 -warning Anchor #broken not found. -valid - -url #broken2 -cache key file://%(curdir)s/%(datadir)s/anchor.html#broken2 -real url file://%(curdir)s/%(datadir)s/anchor.html -name Bla4 -warning Anchor #broken2 not found. -valid diff --git a/linkcheck/checker/tests/data/base/test.txt b/linkcheck/checker/tests/data/base/test.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/linkcheck/checker/tests/data/base1.html b/linkcheck/checker/tests/data/base1.html deleted file mode 100644 index 06c1d5ac..00000000 --- a/linkcheck/checker/tests/data/base1.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/linkcheck/checker/tests/data/base1.html.result b/linkcheck/checker/tests/data/base1.html.result deleted file mode 100644 index 9067660a..00000000 --- a/linkcheck/checker/tests/data/base1.html.result +++ /dev/null @@ -1,14 +0,0 @@ -url file://%(curdir)s/%(datadir)s/base1.html -cache key file://%(curdir)s/%(datadir)s/base1.html -real url file://%(curdir)s/%(datadir)s/base1.html -valid - -url base2.html -cache key file://%(curdir)s/%(datadir)s/base2.html -real url file://%(curdir)s/%(datadir)s/base2.html -valid - -url base2.html (cached) -cache key file://%(curdir)s/%(datadir)s/base2.html -real url file://%(curdir)s/%(datadir)s/base2.html -valid diff --git a/linkcheck/checker/tests/data/base2.html b/linkcheck/checker/tests/data/base2.html deleted file mode 100644 index d6d51698..00000000 --- a/linkcheck/checker/tests/data/base2.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/linkcheck/checker/tests/data/base2.html.result b/linkcheck/checker/tests/data/base2.html.result deleted file mode 100644 index c8dd4ce9..00000000 --- a/linkcheck/checker/tests/data/base2.html.result +++ /dev/null @@ -1,10 +0,0 @@ -url file://%(curdir)s/%(datadir)s/base2.html -cache key file://%(curdir)s/%(datadir)s/base2.html -real url file://%(curdir)s/%(datadir)s/base2.html -valid - -url test.txt -cache key file://%(curdir)s/%(datadir)s/base/test.txt -real url file://%(curdir)s/%(datadir)s/base/test.txt -baseurl file://%(curdir)s/%(datadir)s/base/ -valid diff --git a/linkcheck/checker/tests/data/base3.html b/linkcheck/checker/tests/data/base3.html deleted file mode 100644 index eed04b7c..00000000 --- a/linkcheck/checker/tests/data/base3.html +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/linkcheck/checker/tests/data/base3.html.result b/linkcheck/checker/tests/data/base3.html.result deleted file mode 100644 index 6ebc9ab4..00000000 --- a/linkcheck/checker/tests/data/base3.html.result +++ /dev/null @@ -1,10 +0,0 @@ -url file://%(curdir)s/%(datadir)s/base3.html -cache key file://%(curdir)s/%(datadir)s/base3.html -real url file://%(curdir)s/%(datadir)s/base3.html -valid - -url test.txt -cache key file://%(curdir)s/%(datadir)s/base/test.txt -real url file://%(curdir)s/%(datadir)s/base/test.txt -baseurl file://%(curdir)s/%(datadir)s/base/ -valid diff --git a/linkcheck/checker/tests/data/base4.html b/linkcheck/checker/tests/data/base4.html deleted file mode 100644 index 6dc6cd95..00000000 --- a/linkcheck/checker/tests/data/base4.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - -Blubb - - \ No newline at end of file diff --git a/linkcheck/checker/tests/data/base4.html.result b/linkcheck/checker/tests/data/base4.html.result deleted file mode 100644 index 1df2d505..00000000 --- a/linkcheck/checker/tests/data/base4.html.result +++ /dev/null @@ -1,11 +0,0 @@ -url file://%(curdir)s/%(datadir)s/base4.html -cache key file://%(curdir)s/%(datadir)s/base4.html -real url file://%(curdir)s/%(datadir)s/base4.html -valid - -url test.txt -cache key file://%(curdir)s/%(datadir)s/base/test.txt -real url file://%(curdir)s/%(datadir)s/base/test.txt -name Blubb -baseurl file://%(curdir)s/%(datadir)s/base/ -valid diff --git a/linkcheck/checker/tests/data/cookies.txt b/linkcheck/checker/tests/data/cookies.txt deleted file mode 100644 index 57dd45d8..00000000 --- a/linkcheck/checker/tests/data/cookies.txt +++ /dev/null @@ -1,8 +0,0 @@ -Host: example.com -Path: /hello -Set-cookie: ID="smee" -Set-cookie: spam="egg" - -Scheme: https -Host: example.org -Set-cookie: baggage="elitist"; comment="hologram" diff --git a/linkcheck/checker/tests/data/favicon.ico b/linkcheck/checker/tests/data/favicon.ico deleted file mode 100644 index 3f0bb622..00000000 Binary files a/linkcheck/checker/tests/data/favicon.ico and /dev/null differ diff --git a/linkcheck/checker/tests/data/file.asc b/linkcheck/checker/tests/data/file.asc deleted file mode 100644 index 8a8fc5cd..00000000 --- a/linkcheck/checker/tests/data/file.asc +++ /dev/null @@ -1 +0,0 @@ -file:///etc/group diff --git a/linkcheck/checker/tests/data/file.asc.result b/linkcheck/checker/tests/data/file.asc.result deleted file mode 100644 index 1cf2ca07..00000000 --- a/linkcheck/checker/tests/data/file.asc.result +++ /dev/null @@ -1,4 +0,0 @@ -url file://%(curdir)s/%(datadir)s/file.asc -cache key file://%(curdir)s/%(datadir)s/file.asc -real url file://%(curdir)s/%(datadir)s/file.asc -valid diff --git a/linkcheck/checker/tests/data/file.css b/linkcheck/checker/tests/data/file.css deleted file mode 100644 index dcbf282e..00000000 --- a/linkcheck/checker/tests/data/file.css +++ /dev/null @@ -1,5 +0,0 @@ -@font-face { - src:url(file.html) -} -background-image:url(file.html) -/*background-image:url(broken.html)*/ diff --git a/linkcheck/checker/tests/data/file.css.result b/linkcheck/checker/tests/data/file.css.result deleted file mode 100644 index 100b0991..00000000 --- a/linkcheck/checker/tests/data/file.css.result +++ /dev/null @@ -1,14 +0,0 @@ -url file://%(curdir)s/%(datadir)s/file.css -cache key file://%(curdir)s/%(datadir)s/file.css -real url file://%(curdir)s/%(datadir)s/file.css -valid - -url file.html -cache key file://%(curdir)s/%(datadir)s/file.html -real url file://%(curdir)s/%(datadir)s/file.html -valid - -url file.html (cached) -cache key file://%(curdir)s/%(datadir)s/file.html -real url file://%(curdir)s/%(datadir)s/file.html -valid diff --git a/linkcheck/checker/tests/data/file.html b/linkcheck/checker/tests/data/file.html deleted file mode 100644 index 497c82e0..00000000 --- a/linkcheck/checker/tests/data/file.html +++ /dev/null @@ -1,8 +0,0 @@ -relative url -bad anchor -good anchor -bad anchor -good anchor -javascript url - -anchor diff --git a/linkcheck/checker/tests/data/file.html.result b/linkcheck/checker/tests/data/file.html.result deleted file mode 100644 index 31593c94..00000000 --- a/linkcheck/checker/tests/data/file.html.result +++ /dev/null @@ -1,43 +0,0 @@ -url file://%(curdir)s/%(datadir)s/file.html -cache key file://%(curdir)s/%(datadir)s/file.html -real url file://%(curdir)s/%(datadir)s/file.html -valid - -url file.html (cached) -cache key file://%(curdir)s/%(datadir)s/file.html -real url file://%(curdir)s/%(datadir)s/file.html -name relative url -valid - -url file.html#isnix -cache key file://%(curdir)s/%(datadir)s/file.html#isnix -real url file://%(curdir)s/%(datadir)s/file.html -name bad anchor -warning Anchor #isnix not found. -valid - -url file.html#iswas -cache key file://%(curdir)s/%(datadir)s/file.html#iswas -real url file://%(curdir)s/%(datadir)s/file.html -name good anchor -valid - -url #isnix (cached) -cache key file://%(curdir)s/%(datadir)s/file.html#isnix -real url file://%(curdir)s/%(datadir)s/file.html -name bad anchor -warning Anchor #isnix not found. -valid - -url #iswas (cached) -cache key file://%(curdir)s/%(datadir)s/file.html#iswas -real url file://%(curdir)s/%(datadir)s/file.html -name good anchor -valid - -url javascript:loadthis() -cache key javascript:loadthis() -real url javascript:loadthis() -name javascript url -warning Javascript URL ignored. -valid diff --git a/linkcheck/checker/tests/data/file.txt b/linkcheck/checker/tests/data/file.txt deleted file mode 100644 index 8a8fc5cd..00000000 --- a/linkcheck/checker/tests/data/file.txt +++ /dev/null @@ -1 +0,0 @@ -file:///etc/group diff --git a/linkcheck/checker/tests/data/file.txt.result b/linkcheck/checker/tests/data/file.txt.result deleted file mode 100644 index ecb20fa1..00000000 --- a/linkcheck/checker/tests/data/file.txt.result +++ /dev/null @@ -1,4 +0,0 @@ -url file://%(curdir)s/%(datadir)s/file.txt -cache key file://%(curdir)s/%(datadir)s/file.txt -real url file://%(curdir)s/%(datadir)s/file.txt -valid diff --git a/linkcheck/checker/tests/data/frames.html b/linkcheck/checker/tests/data/frames.html deleted file mode 100644 index 70d9a80d..00000000 --- a/linkcheck/checker/tests/data/frames.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/linkcheck/checker/tests/data/frames.html.result b/linkcheck/checker/tests/data/frames.html.result deleted file mode 100644 index a537c835..00000000 --- a/linkcheck/checker/tests/data/frames.html.result +++ /dev/null @@ -1,14 +0,0 @@ -url file://%(curdir)s/%(datadir)s/frames.html -cache key file://%(curdir)s/%(datadir)s/frames.html -real url file://%(curdir)s/%(datadir)s/frames.html -valid - -url frames.html (cached) -cache key file://%(curdir)s/%(datadir)s/frames.html -real url file://%(curdir)s/%(datadir)s/frames.html -valid - -url frames.html (cached) -cache key file://%(curdir)s/%(datadir)s/frames.html -real url file://%(curdir)s/%(datadir)s/frames.html -valid diff --git a/linkcheck/checker/tests/data/http.html b/linkcheck/checker/tests/data/http.html deleted file mode 100644 index a067e313..00000000 --- a/linkcheck/checker/tests/data/http.html +++ /dev/null @@ -1,39 +0,0 @@ -Just some HTTP links -bad url -ok -one slash -no slash -no url -no url, one slash -no url, no slash -unquoted ampersand -unquoted -should be cached -should be cached - -should not be cached -should not be cached - -html entities - - - -
-
- - - - - - - - - - -no beginning quote - - - - - - -blubb - - - - - -SWF - diff --git a/linkcheck/checker/tests/data/misc.html.result b/linkcheck/checker/tests/data/misc.html.result deleted file mode 100644 index 027495ff..00000000 --- a/linkcheck/checker/tests/data/misc.html.result +++ /dev/null @@ -1,37 +0,0 @@ -url file://%(curdir)s/%(datadir)s/misc.html -cache key file://%(curdir)s/%(datadir)s/misc.html -real url file://%(curdir)s/%(datadir)s/misc.html -valid - -url http://localhost:8001/ -cache key http://localhost:8001/ -real url http://localhost:8001/ -error - -url favicon.ico -cache key file://%(curdir)s/%(datadir)s/favicon.ico -real url file://%(curdir)s/%(datadir)s/favicon.ico -valid - -url favicon.ico (cached) -cache key file://%(curdir)s/%(datadir)s/favicon.ico -real url file://%(curdir)s/%(datadir)s/favicon.ico -valid - -url http://imadööfus.org%%0D%%3Cfont%%20face=%%22Verdana,%%20Arial,%%20Helvetica,%%20sans-serif%%22%%20size=%%222%%22%%3E%%3Chttp://www.imadoofus.org%%3E%%20%%0D%%20%%20%%20%%20%%20%%20%%20%%20%%20%%20%%20%%20%%20%%20 -cache key None -real url None -name blubb -error - -url -cache key None -real url None -error - -url test.swf -cache key file://%(curdir)s/%(datadir)s/test.swf -real url file://%(curdir)s/%(datadir)s/test.swf -name SWF -valid - diff --git a/linkcheck/checker/tests/data/newurl.html b/linkcheck/checker/tests/data/newurl.html deleted file mode 100644 index 501e2721..00000000 --- a/linkcheck/checker/tests/data/newurl.html +++ /dev/null @@ -1 +0,0 @@ -Recursive Redirect diff --git a/linkcheck/checker/tests/data/norobots.html b/linkcheck/checker/tests/data/norobots.html deleted file mode 100644 index 795e8174..00000000 --- a/linkcheck/checker/tests/data/norobots.html +++ /dev/null @@ -1,2 +0,0 @@ - -bla diff --git a/linkcheck/checker/tests/data/norobots.html.result b/linkcheck/checker/tests/data/norobots.html.result deleted file mode 100644 index 89439c95..00000000 --- a/linkcheck/checker/tests/data/norobots.html.result +++ /dev/null @@ -1,4 +0,0 @@ -url file://%(curdir)s/%(datadir)s/norobots.html -cache key file://%(curdir)s/%(datadir)s/norobots.html -real url file://%(curdir)s/%(datadir)s/norobots.html -valid diff --git a/linkcheck/checker/tests/data/test.swf b/linkcheck/checker/tests/data/test.swf deleted file mode 100644 index e161628c..00000000 --- a/linkcheck/checker/tests/data/test.swf +++ /dev/null @@ -1 +0,0 @@ -qü'4309 uq0'34 tuqüt9 qeürgjsadöfg jias#http://www.example.org/°° diff --git a/linkcheck/checker/tests/data/urllist.txt b/linkcheck/checker/tests/data/urllist.txt deleted file mode 100644 index 466f2943..00000000 --- a/linkcheck/checker/tests/data/urllist.txt +++ /dev/null @@ -1,9 +0,0 @@ -# LinkChecker url list -# empty lines and - # comments are ignored - -file.html -file.html#isnix -file.html#iswas - -javascript:loadthis() diff --git a/linkcheck/checker/tests/data/urllist.txt.result b/linkcheck/checker/tests/data/urllist.txt.result deleted file mode 100644 index 6d997c7d..00000000 --- a/linkcheck/checker/tests/data/urllist.txt.result +++ /dev/null @@ -1,26 +0,0 @@ -url file://%(curdir)s/%(datadir)s/urllist.txt -cache key file://%(curdir)s/%(datadir)s/urllist.txt -real url file://%(curdir)s/%(datadir)s/urllist.txt -valid - -url file.html -cache key file://%(curdir)s/%(datadir)s/file.html -real url file://%(curdir)s/%(datadir)s/file.html -valid - -url file.html#isnix -cache key file://%(curdir)s/%(datadir)s/file.html#isnix -real url file://%(curdir)s/%(datadir)s/file.html -warning Anchor #isnix not found. -valid - -url file.html#iswas -cache key file://%(curdir)s/%(datadir)s/file.html#iswas -real url file://%(curdir)s/%(datadir)s/file.html -valid - -url javascript:loadthis() -cache key javascript:loadthis() -real url javascript:loadthis() -warning Javascript URL ignored. -valid diff --git a/linkcheck/tests/__init__.py b/linkcheck/tests/__init__.py deleted file mode 100644 index cc449d24..00000000 --- a/linkcheck/tests/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2004-2008 Bastian Kleineidam -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -""" -Test package. -""" diff --git a/linkcheck/checker/tests/__init__.py b/tests/checker/__init__.py similarity index 97% rename from linkcheck/checker/tests/__init__.py rename to tests/checker/__init__.py index 26f8c28e..d7f224bf 100644 --- a/linkcheck/checker/tests/__init__.py +++ b/tests/checker/__init__.py @@ -23,7 +23,6 @@ import re import codecs import difflib import unittest - import linkcheck.checker import linkcheck.configuration import linkcheck.director @@ -101,7 +100,7 @@ def get_file (filename=None): """ Get file name located within 'data' directory. """ - directory = os.path.join("linkcheck", "checker", "tests", "data") + directory = os.path.join("tests", "checker", "data") if filename: return unicode(os.path.join(directory, filename)) return unicode(directory) @@ -160,8 +159,8 @@ class LinkCheckTest (unittest.TestCase): """Return current and data directory as dictionary. You can augment the dict with keyword attributes.""" d = { - 'curdir': linkcheck.checker.tests.get_file_url(os.getcwd()), - 'datadir': "linkcheck/checker/tests/data", + 'curdir': get_file_url(os.getcwd()), + 'datadir': "tests/checker/data", } d.update(kwargs) return d diff --git a/linkcheck/checker/tests/httptest.py b/tests/checker/httptest.py similarity index 97% rename from linkcheck/checker/tests/httptest.py rename to tests/checker/httptest.py index f3665554..ababd6e5 100644 --- a/linkcheck/checker/tests/httptest.py +++ b/tests/checker/httptest.py @@ -22,8 +22,7 @@ import SimpleHTTPServer import BaseHTTPServer import httplib import time - -import linkcheck.checker.tests +from . import LinkCheckTest class StoppableHttpRequestHandler (SimpleHTTPServer.SimpleHTTPRequestHandler, object): @@ -88,7 +87,7 @@ class NoQueryHttpRequestHandler (StoppableHttpRequestHandler): super(NoQueryHttpRequestHandler, self).do_HEAD() -class HttpServerTest (linkcheck.checker.tests.LinkCheckTest): +class HttpServerTest (LinkCheckTest): """ Start/stop an HTTP server that can be used for testing. """ diff --git a/linkcheck/checker/tests/test_anchor.py b/tests/checker/test_anchor.py similarity index 92% rename from linkcheck/checker/tests/test_anchor.py rename to tests/checker/test_anchor.py index ca698b4c..41ee1e76 100644 --- a/linkcheck/checker/tests/test_anchor.py +++ b/tests/checker/test_anchor.py @@ -19,11 +19,10 @@ Test html anchor parsing and checking. """ import unittest - -import linkcheck.checker.tests +from . import LinkCheckTest -class TestAnchor (linkcheck.checker.tests.LinkCheckTest): +class TestAnchor (LinkCheckTest): """ Test anchor checking of HTML pages. """ diff --git a/linkcheck/checker/tests/test_base.py b/tests/checker/test_base.py similarity index 94% rename from linkcheck/checker/tests/test_base.py rename to tests/checker/test_base.py index 9dd21e5c..97496bc3 100644 --- a/linkcheck/checker/tests/test_base.py +++ b/tests/checker/test_base.py @@ -19,10 +19,10 @@ Test html tag parsing. """ import unittest +from . import LinkCheckTest -import linkcheck.checker.tests -class TestBase (linkcheck.checker.tests.LinkCheckTest): +class TestBase (LinkCheckTest): """ Test links of base*.html files. """ diff --git a/linkcheck/checker/tests/test_error.py b/tests/checker/test_error.py similarity index 97% rename from linkcheck/checker/tests/test_error.py rename to tests/checker/test_error.py index dbd3558c..288ef847 100644 --- a/linkcheck/checker/tests/test_error.py +++ b/tests/checker/test_error.py @@ -19,12 +19,10 @@ Test error checking. """ import unittest - -import linkcheck.checker.tests -import linkcheck.url +from . import LinkCheckTest -class TestError (linkcheck.checker.tests.LinkCheckTest): +class TestError (LinkCheckTest): """ Test unrecognized or syntactically wrong links. """ diff --git a/linkcheck/checker/tests/test_fcgi.py b/tests/checker/test_fcgi.py similarity index 100% rename from linkcheck/checker/tests/test_fcgi.py rename to tests/checker/test_fcgi.py diff --git a/linkcheck/checker/tests/test_file.py b/tests/checker/test_file.py similarity index 97% rename from linkcheck/checker/tests/test_file.py rename to tests/checker/test_file.py index 9217dcc4..b8304203 100644 --- a/linkcheck/checker/tests/test_file.py +++ b/tests/checker/test_file.py @@ -20,10 +20,10 @@ Test file parsing. import unittest import os +from . import LinkCheckTest -import linkcheck.checker.tests -class TestFile (linkcheck.checker.tests.LinkCheckTest): +class TestFile (LinkCheckTest): """ Test file:// link checking (and file content parsing). """ diff --git a/linkcheck/checker/tests/test_frames.py b/tests/checker/test_frames.py similarity index 92% rename from linkcheck/checker/tests/test_frames.py rename to tests/checker/test_frames.py index e72cad2c..afd5e4b6 100644 --- a/linkcheck/checker/tests/test_frames.py +++ b/tests/checker/test_frames.py @@ -19,10 +19,10 @@ Test html tag parsing. """ import unittest +from . import LinkCheckTest -import linkcheck.checker.tests -class TestFrames (linkcheck.checker.tests.LinkCheckTest): +class TestFrames (LinkCheckTest): """ Test link checking of HTML framesets. """ diff --git a/linkcheck/checker/tests/test_ftp.py b/tests/checker/test_ftp.py similarity index 97% rename from linkcheck/checker/tests/test_ftp.py rename to tests/checker/test_ftp.py index 7b46999c..0d9471c5 100644 --- a/linkcheck/checker/tests/test_ftp.py +++ b/tests/checker/test_ftp.py @@ -19,11 +19,10 @@ Test ftp checking. """ import unittest - -import linkcheck.checker.tests +from . import LinkCheckTest -class TestFtp (linkcheck.checker.tests.LinkCheckTest): +class TestFtp (LinkCheckTest): """ Test ftp: link checking. """ diff --git a/linkcheck/checker/tests/test_http.py b/tests/checker/test_http.py similarity index 95% rename from linkcheck/checker/tests/test_http.py rename to tests/checker/test_http.py index 8d15ae0c..dffb721d 100644 --- a/linkcheck/checker/tests/test_http.py +++ b/tests/checker/test_http.py @@ -33,7 +33,7 @@ class TestHttp (httptest.HttpServerTest): def test_html (self): try: self.start_server(handler=CookieRedirectHttpRequestHandler) - url = u"http://localhost:%d/linkcheck/checker/tests/data/" \ + url = u"http://localhost:%d/tests/checker/data/" \ u"http.html" % self.port resultlines = self.get_resultlines("http.html") self.direct(url, resultlines, recursionlevel=1) @@ -86,7 +86,7 @@ class TestHttp (httptest.HttpServerTest): self.direct(url, resultlines, recursionlevel=0) def redirect2_http_test (self): - url = u"http://localhost:%d/linkcheck/checker/tests/data/redirect.html" % \ + url = u"http://localhost:%d/tests/checker/data/redirect.html" % \ self.port nurl = url rurl = url.replace("redirect", "newurl") @@ -132,7 +132,7 @@ class TestHttp (httptest.HttpServerTest): """ os.environ["http_proxy"] = "http://example.org:8877" confargs = {"noproxyfor": [re.compile("localhost")]} - url = u"http://localhost:%d/linkcheck/checker/tests/data/http.html" % \ + url = u"http://localhost:%d/tests/checker/data/http.html" % \ self.port nurl = url resultlines = [ @@ -147,7 +147,7 @@ class TestHttp (httptest.HttpServerTest): del os.environ["http_proxy"] def swf_test (self): - url = u"http://localhost:%d/linkcheck/checker/tests/data/" \ + url = u"http://localhost:%d/tests/checker/data/" \ u"test.swf" % self.port resultlines = [ u"url %s" % url, diff --git a/linkcheck/checker/tests/test_https.py b/tests/checker/test_https.py similarity index 93% rename from linkcheck/checker/tests/test_https.py rename to tests/checker/test_https.py index 2d3925d8..5155f647 100644 --- a/linkcheck/checker/tests/test_https.py +++ b/tests/checker/test_https.py @@ -19,10 +19,10 @@ Test news checking. """ import unittest +from . import LinkCheckTest -import linkcheck.checker.tests -class TestHttps (linkcheck.checker.tests.LinkCheckTest): +class TestHttps (LinkCheckTest): """ Test https: link checking. """ diff --git a/linkcheck/checker/tests/test_internpat.py b/tests/checker/test_internpat.py similarity index 100% rename from linkcheck/checker/tests/test_internpat.py rename to tests/checker/test_internpat.py diff --git a/linkcheck/checker/tests/test_mail.py b/tests/checker/test_mail.py similarity index 98% rename from linkcheck/checker/tests/test_mail.py rename to tests/checker/test_mail.py index 814d7486..595fe3c4 100644 --- a/linkcheck/checker/tests/test_mail.py +++ b/tests/checker/test_mail.py @@ -19,10 +19,10 @@ Test mail checking. """ import unittest +from . import LinkCheckTest -import linkcheck.checker.tests -class TestMail (linkcheck.checker.tests.LinkCheckTest): +class TestMail (LinkCheckTest): """ Test mailto: link checking. """ diff --git a/linkcheck/checker/tests/test_misc.py b/tests/checker/test_misc.py similarity index 93% rename from linkcheck/checker/tests/test_misc.py rename to tests/checker/test_misc.py index 43c38148..86671184 100644 --- a/linkcheck/checker/tests/test_misc.py +++ b/tests/checker/test_misc.py @@ -19,10 +19,10 @@ Test miscellaneous html tag parsing. """ import unittest +from . import LinkCheckTest -import linkcheck.checker.tests -class TestMisc (linkcheck.checker.tests.LinkCheckTest): +class TestMisc (LinkCheckTest): """ Test link checking of HTML tags. """ diff --git a/linkcheck/checker/tests/test_news.py b/tests/checker/test_news.py similarity index 97% rename from linkcheck/checker/tests/test_news.py rename to tests/checker/test_news.py index 71518742..35d9cd04 100644 --- a/linkcheck/checker/tests/test_news.py +++ b/tests/checker/test_news.py @@ -19,12 +19,10 @@ Test news checking. """ import unittest - -import linkcheck.checker.tests -import linkcheck.url +from . import LinkCheckTest -class TestNews (linkcheck.checker.tests.LinkCheckTest): +class TestNews (LinkCheckTest): """ Test nntp: and news: link checking. """ diff --git a/linkcheck/checker/tests/test_robotstxt.py b/tests/checker/test_robotstxt.py similarity index 92% rename from linkcheck/checker/tests/test_robotstxt.py rename to tests/checker/test_robotstxt.py index 41c0fc71..88cbb517 100644 --- a/linkcheck/checker/tests/test_robotstxt.py +++ b/tests/checker/test_robotstxt.py @@ -19,11 +19,10 @@ Test HTML robots.txt parsing. """ import unittest - -import linkcheck.checker.tests +from . import LinkCheckTest -class TestRobotsTxt (linkcheck.checker.tests.LinkCheckTest): +class TestRobotsTxt (LinkCheckTest): """ Test robots.txt directive parsing in HTML files. """ diff --git a/linkcheck/checker/tests/test_telnet.py b/tests/checker/test_telnet.py similarity index 95% rename from linkcheck/checker/tests/test_telnet.py rename to tests/checker/test_telnet.py index 1af9e8dd..d1e72e6c 100644 --- a/linkcheck/checker/tests/test_telnet.py +++ b/tests/checker/test_telnet.py @@ -19,11 +19,10 @@ Test telnet checking. """ import unittest - -import linkcheck.checker.tests +from . import LinkCheckTest -class TestTelnet (linkcheck.checker.tests.LinkCheckTest): +class TestTelnet (LinkCheckTest): """ Test telnet: link checking. """ diff --git a/linkcheck/configuration/tests/__init__.py b/tests/configuration/__init__.py similarity index 100% rename from linkcheck/configuration/tests/__init__.py rename to tests/configuration/__init__.py diff --git a/linkcheck/configuration/tests/data/config0.ini b/tests/configuration/data/config0.ini similarity index 100% rename from linkcheck/configuration/tests/data/config0.ini rename to tests/configuration/data/config0.ini diff --git a/linkcheck/configuration/tests/data/config1.ini b/tests/configuration/data/config1.ini similarity index 100% rename from linkcheck/configuration/tests/data/config1.ini rename to tests/configuration/data/config1.ini diff --git a/linkcheck/configuration/tests/data/config2.ini b/tests/configuration/data/config2.ini similarity index 100% rename from linkcheck/configuration/tests/data/config2.ini rename to tests/configuration/data/config2.ini diff --git a/linkcheck/configuration/tests/test_config.py b/tests/configuration/test_config.py similarity index 98% rename from linkcheck/configuration/tests/test_config.py rename to tests/configuration/test_config.py index 59d50b3f..d21182c7 100644 --- a/linkcheck/configuration/tests/test_config.py +++ b/tests/configuration/test_config.py @@ -25,7 +25,7 @@ import linkcheck.configuration def get_file (filename=None): """Get file name located within 'data' directory.""" - directory = os.path.join("linkcheck", "configuration", "tests", "data") + directory = os.path.join("tests", "configuration", "data") if filename: return unicode(os.path.join(directory, filename)) return unicode(directory) diff --git a/linkcheck/dns/tests/__init__.py b/tests/dns/__init__.py similarity index 100% rename from linkcheck/dns/tests/__init__.py rename to tests/dns/__init__.py diff --git a/linkcheck/dns/tests/example b/tests/dns/example similarity index 100% rename from linkcheck/dns/tests/example rename to tests/dns/example diff --git a/linkcheck/dns/tests/example1.good b/tests/dns/example1.good similarity index 100% rename from linkcheck/dns/tests/example1.good rename to tests/dns/example1.good diff --git a/linkcheck/dns/tests/example2.good b/tests/dns/example2.good similarity index 100% rename from linkcheck/dns/tests/example2.good rename to tests/dns/example2.good diff --git a/linkcheck/dns/tests/test_flags.py b/tests/dns/test_flags.py similarity index 100% rename from linkcheck/dns/tests/test_flags.py rename to tests/dns/test_flags.py diff --git a/linkcheck/dns/tests/test_message.py b/tests/dns/test_message.py similarity index 100% rename from linkcheck/dns/tests/test_message.py rename to tests/dns/test_message.py diff --git a/linkcheck/dns/tests/test_name.py b/tests/dns/test_name.py similarity index 100% rename from linkcheck/dns/tests/test_name.py rename to tests/dns/test_name.py diff --git a/linkcheck/dns/tests/test_namedict.py b/tests/dns/test_namedict.py similarity index 100% rename from linkcheck/dns/tests/test_namedict.py rename to tests/dns/test_namedict.py diff --git a/linkcheck/dns/tests/test_ntoaaton.py b/tests/dns/test_ntoaaton.py similarity index 100% rename from linkcheck/dns/tests/test_ntoaaton.py rename to tests/dns/test_ntoaaton.py diff --git a/linkcheck/dns/tests/test_rdtypeandclass.py b/tests/dns/test_rdtypeandclass.py similarity index 100% rename from linkcheck/dns/tests/test_rdtypeandclass.py rename to tests/dns/test_rdtypeandclass.py diff --git a/linkcheck/dns/tests/test_resolver.py b/tests/dns/test_resolver.py similarity index 100% rename from linkcheck/dns/tests/test_resolver.py rename to tests/dns/test_resolver.py diff --git a/linkcheck/dns/tests/test_rrset.py b/tests/dns/test_rrset.py similarity index 100% rename from linkcheck/dns/tests/test_rrset.py rename to tests/dns/test_rrset.py diff --git a/linkcheck/dns/tests/test_set.py b/tests/dns/test_set.py similarity index 100% rename from linkcheck/dns/tests/test_set.py rename to tests/dns/test_set.py diff --git a/linkcheck/dns/tests/test_tokenizer.py b/tests/dns/test_tokenizer.py similarity index 100% rename from linkcheck/dns/tests/test_tokenizer.py rename to tests/dns/test_tokenizer.py diff --git a/linkcheck/dns/tests/test_update.py b/tests/dns/test_update.py similarity index 100% rename from linkcheck/dns/tests/test_update.py rename to tests/dns/test_update.py diff --git a/linkcheck/dns/tests/test_zone.py b/tests/dns/test_zone.py similarity index 99% rename from linkcheck/dns/tests/test_zone.py rename to tests/dns/test_zone.py index 7bbf728e..a5a5d93a 100644 --- a/linkcheck/dns/tests/test_zone.py +++ b/tests/dns/test_zone.py @@ -27,7 +27,7 @@ import linkcheck.dns.rdatatype import linkcheck.dns.rrset import linkcheck.dns.zone -_paths = ["linkcheck", "dns", "tests"] +_paths = ["tests", "dns"] def fname (name, sep=None): args = tuple(_paths + [name]) diff --git a/linkcheck/tests/test_cgi.py b/tests/test_cgi.py similarity index 100% rename from linkcheck/tests/test_cgi.py rename to tests/test_cgi.py diff --git a/linkcheck/tests/test_clamav.py b/tests/test_clamav.py similarity index 100% rename from linkcheck/tests/test_clamav.py rename to tests/test_clamav.py diff --git a/linkcheck/tests/test_containers.py b/tests/test_containers.py similarity index 100% rename from linkcheck/tests/test_containers.py rename to tests/test_containers.py diff --git a/linkcheck/tests/test_cookies.py b/tests/test_cookies.py similarity index 100% rename from linkcheck/tests/test_cookies.py rename to tests/test_cookies.py diff --git a/linkcheck/tests/test_decorators.py b/tests/test_decorators.py similarity index 100% rename from linkcheck/tests/test_decorators.py rename to tests/test_decorators.py diff --git a/linkcheck/tests/test_filenames.py b/tests/test_filenames.py similarity index 100% rename from linkcheck/tests/test_filenames.py rename to tests/test_filenames.py diff --git a/linkcheck/tests/test_linkname.py b/tests/test_linkname.py similarity index 100% rename from linkcheck/tests/test_linkname.py rename to tests/test_linkname.py diff --git a/linkcheck/tests/test_linkparser.py b/tests/test_linkparser.py similarity index 100% rename from linkcheck/tests/test_linkparser.py rename to tests/test_linkparser.py diff --git a/linkcheck/tests/test_parser.py b/tests/test_parser.py similarity index 100% rename from linkcheck/tests/test_parser.py rename to tests/test_parser.py diff --git a/linkcheck/tests/test_robotparser.py b/tests/test_robotparser.py similarity index 100% rename from linkcheck/tests/test_robotparser.py rename to tests/test_robotparser.py diff --git a/linkcheck/tests/test_robotstxt.py b/tests/test_robotstxt.py similarity index 100% rename from linkcheck/tests/test_robotstxt.py rename to tests/test_robotstxt.py diff --git a/linkcheck/tests/test_strformat.py b/tests/test_strformat.py similarity index 100% rename from linkcheck/tests/test_strformat.py rename to tests/test_strformat.py diff --git a/linkcheck/tests/test_url.py b/tests/test_url.py similarity index 100% rename from linkcheck/tests/test_url.py rename to tests/test_url.py diff --git a/linkcheck/tests/test_urlbuild.py b/tests/test_urlbuild.py similarity index 95% rename from linkcheck/tests/test_urlbuild.py rename to tests/test_urlbuild.py index f5a86bec..e1988306 100644 --- a/linkcheck/tests/test_urlbuild.py +++ b/tests/test_urlbuild.py @@ -38,7 +38,7 @@ class TestUrlBuild (unittest.TestCase): """ def test_http_build (self): - parent_url = "http://localhost:8001/linkcheck/checker/tests/data/http.html" + parent_url = "http://localhost:8001/tests/checker/data/http.html" base_url = "http://" recursion_level = 0 aggregate = get_test_aggregate()