mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-12 10:30:58 +00:00
Remove spaces after names in class definitions
This commit is contained in:
parent
16fe12fb50
commit
fc11d08968
85 changed files with 102 additions and 101 deletions
|
|
@ -276,7 +276,7 @@ class Colorizer:
|
|||
return getattr(self.fp, name)
|
||||
|
||||
|
||||
class ColoredStreamHandler (logging.StreamHandler):
|
||||
class ColoredStreamHandler(logging.StreamHandler):
|
||||
"""Send colored log messages to streams (file-like objects)."""
|
||||
|
||||
def __init__ (self, strm=None):
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import socket
|
|||
from . import urlbase
|
||||
|
||||
|
||||
class DnsUrl (urlbase.UrlBase):
|
||||
class DnsUrl(urlbase.UrlBase):
|
||||
"""
|
||||
Url link with dns scheme.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ def is_absolute_path (path):
|
|||
return path.startswith("/")
|
||||
|
||||
|
||||
class FileUrl (urlbase.UrlBase):
|
||||
class FileUrl(urlbase.UrlBase):
|
||||
"""
|
||||
Url link with file scheme.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ from . import proxysupport, httpurl, internpaturl, get_index_html
|
|||
from .const import WARN_FTP_MISSING_SLASH
|
||||
|
||||
|
||||
class FtpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
||||
class FtpUrl(internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
||||
"""
|
||||
Url link with ftp scheme.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ unicode_safe = strformat.unicode_safe
|
|||
# match for robots meta element content attribute
|
||||
nofollow_re = re.compile(r"\bnofollow\b", re.IGNORECASE)
|
||||
|
||||
class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
||||
|
||||
class HttpUrl(internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
||||
"""
|
||||
Url link with http scheme.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Handle ignored URLs.
|
|||
|
||||
from . import unknownurl
|
||||
|
||||
class IgnoreUrl (unknownurl.UnknownUrl):
|
||||
class IgnoreUrl(unknownurl.UnknownUrl):
|
||||
"""Always ignored URL."""
|
||||
|
||||
def is_ignored (self):
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ def get_intern_pattern (url):
|
|||
return "^%s://%s%s" % tuple(args)
|
||||
|
||||
|
||||
class InternPatternUrl (urlbase.UrlBase):
|
||||
class InternPatternUrl(urlbase.UrlBase):
|
||||
"""Class supporting an intern URL pattern."""
|
||||
|
||||
def get_intern_pattern (self, url=None):
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ def is_missing_quote (addr):
|
|||
EMAIL_CGI_ADDRESS = ("to", "cc", "bcc")
|
||||
EMAIL_CGI_SUBJECT = "subject"
|
||||
|
||||
class MailtoUrl (urlbase.UrlBase):
|
||||
class MailtoUrl(urlbase.UrlBase):
|
||||
"""
|
||||
Url link with mailto scheme.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ from .const import WARN_NNTP_NO_SERVER, WARN_NNTP_NO_NEWSGROUP
|
|||
|
||||
random.seed()
|
||||
|
||||
class NntpUrl (urlbase.UrlBase):
|
||||
class NntpUrl(urlbase.UrlBase):
|
||||
"""
|
||||
Url link with NNTP scheme.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ def encode(s, encoding="iso-8859-1", errors="ignore"):
|
|||
return s.encode(encoding, errors)
|
||||
|
||||
|
||||
class TelnetUrl (urlbase.UrlBase):
|
||||
class TelnetUrl(urlbase.UrlBase):
|
||||
"""
|
||||
Url link with telnet scheme.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import re
|
|||
from . import urlbase
|
||||
|
||||
|
||||
class UnknownUrl (urlbase.UrlBase):
|
||||
class UnknownUrl(urlbase.UrlBase):
|
||||
"""Handle unknown or just plain broken URLs."""
|
||||
|
||||
def build_url (self):
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ def get_certifi_file():
|
|||
|
||||
|
||||
# dynamic options
|
||||
class Configuration (dict):
|
||||
class Configuration(dict):
|
||||
"""
|
||||
Storage for configuration options. Options can both be given from
|
||||
the command line as well as from configuration files.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ def read_multiline (value):
|
|||
yield line
|
||||
|
||||
|
||||
class LCConfigParser (RawConfigParser):
|
||||
class LCConfigParser(RawConfigParser):
|
||||
"""
|
||||
Parse a LinkChecker configuration file.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
Special container classes.
|
||||
"""
|
||||
|
||||
class LFUCache (dict):
|
||||
class LFUCache(dict):
|
||||
"""Limited cache which purges least frequently used items."""
|
||||
|
||||
def __init__ (self, size=1000):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from . import task
|
|||
from .. import log, LOG_CHECK, strformat
|
||||
|
||||
|
||||
class Interrupt (task.CheckedTask):
|
||||
class Interrupt(task.CheckedTask):
|
||||
"""Thread that raises KeyboardInterrupt after a specified duration.
|
||||
This gives us a portable SIGALRM implementation.
|
||||
The duration is checked every 5 seconds.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import time
|
|||
from . import task
|
||||
|
||||
|
||||
class Status (task.LoggedCheckedTask):
|
||||
class Status(task.LoggedCheckedTask):
|
||||
"""Thread that gathers and logs the status periodically."""
|
||||
|
||||
def __init__ (self, aggregator, wait_seconds):
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from .. import threader
|
|||
from . import console
|
||||
|
||||
|
||||
class CheckedTask (threader.StoppableThread):
|
||||
class CheckedTask(threader.StoppableThread):
|
||||
"""Stoppable URL check task, handling error conditions while running."""
|
||||
|
||||
def run (self):
|
||||
|
|
@ -43,7 +43,7 @@ class CheckedTask (threader.StoppableThread):
|
|||
pass
|
||||
|
||||
|
||||
class LoggedCheckedTask (CheckedTask):
|
||||
class LoggedCheckedTask(CheckedTask):
|
||||
"""URL check task with a logger instance and internal error handling."""
|
||||
|
||||
def __init__ (self, logger):
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ def install_builtin (translator, do_unicode):
|
|||
# also install ngettext
|
||||
builtins.__dict__['_n'] = translator.ngettext
|
||||
|
||||
class Translator (gettext.GNUTranslations):
|
||||
class Translator(gettext.GNUTranslations):
|
||||
"""A translation class always installing its gettext methods into the
|
||||
default namespace."""
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ class Translator (gettext.GNUTranslations):
|
|||
install_builtin(self, do_unicode)
|
||||
|
||||
|
||||
class NullTranslator (gettext.NullTranslations):
|
||||
class NullTranslator(gettext.NullTranslations):
|
||||
"""A dummy translation class always installing its gettext methods into
|
||||
the default namespace."""
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class LogStatistics:
|
|||
self.internal_errors += 1
|
||||
|
||||
|
||||
class _Logger (abc.ABC):
|
||||
class _Logger(abc.ABC):
|
||||
"""
|
||||
Base class for logging of checked urls. It defines the public API
|
||||
(see below) and offers basic functionality for all loggers.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from linkcheck.configuration import get_user_data
|
|||
from . import _Logger
|
||||
|
||||
|
||||
class BlacklistLogger (_Logger):
|
||||
class BlacklistLogger(_Logger):
|
||||
"""
|
||||
Updates a blacklist of wrong links. If a link on the blacklist
|
||||
is working (again), it is removed from the list. So after n days
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ Columns = (
|
|||
)
|
||||
|
||||
|
||||
class CSVLogger (_Logger):
|
||||
class CSVLogger(_Logger):
|
||||
"""
|
||||
CSV output, consisting of one line per entry. Entries are
|
||||
separated by a separator (a semicolon per default).
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from .. import strformat
|
|||
from builtins import str as str_text
|
||||
|
||||
|
||||
class CustomXMLLogger (xmllog._XMLLogger):
|
||||
class CustomXMLLogger(xmllog._XMLLogger):
|
||||
"""
|
||||
XML custom output for easy post-processing.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ http://www.graphviz.org/doc/info/lang.html
|
|||
from .graph import _GraphLogger
|
||||
|
||||
|
||||
class DOTLogger (_GraphLogger):
|
||||
class DOTLogger(_GraphLogger):
|
||||
"""
|
||||
Generates .dot sitemap graphs. Use graphviz to see the sitemap graph.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ A gml logger.
|
|||
from .graph import _GraphLogger
|
||||
|
||||
|
||||
class GMLLogger (_GraphLogger):
|
||||
class GMLLogger(_GraphLogger):
|
||||
"""GML means Graph Modeling Language. Use a GML tool to see
|
||||
the sitemap graph."""
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from ..decorators import notimplemented
|
|||
import re
|
||||
|
||||
|
||||
class _GraphLogger (_Logger):
|
||||
class _GraphLogger(_Logger):
|
||||
"""Provide base method to get node data."""
|
||||
|
||||
def __init__ (self, **kwargs):
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from .xmllog import _XMLLogger
|
|||
from .graph import _GraphLogger
|
||||
|
||||
|
||||
class GraphXMLLogger (_XMLLogger, _GraphLogger):
|
||||
class GraphXMLLogger(_XMLLogger, _GraphLogger):
|
||||
"""XML output mirroring the GML structure. Easy to parse with any XML
|
||||
tool."""
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ HTML_HEADER = """<!DOCTYPE HTML>
|
|||
"""
|
||||
|
||||
|
||||
class HtmlLogger (_Logger):
|
||||
class HtmlLogger(_Logger):
|
||||
"""Logger with HTML output."""
|
||||
|
||||
LoggerName = 'html'
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ A dummy logger.
|
|||
from . import _Logger
|
||||
|
||||
|
||||
class NoneLogger (_Logger):
|
||||
class NoneLogger(_Logger):
|
||||
"""
|
||||
Dummy logger printing nothing.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ ChangeFreqs = (
|
|||
HTTP_SCHEMES = ('http:', 'https:')
|
||||
HTML_TYPES = ('text/html', "application/xhtml+xml")
|
||||
|
||||
class SitemapXmlLogger (xmllog._XMLLogger):
|
||||
class SitemapXmlLogger(xmllog._XMLLogger):
|
||||
"""Sitemap XML output according to http://www.sitemaps.org/protocol.html
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ def intify (s):
|
|||
return 0
|
||||
|
||||
|
||||
class SQLLogger (_Logger):
|
||||
class SQLLogger(_Logger):
|
||||
"""
|
||||
SQL output, should work with any SQL database (not tested).
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from .. import ansicolor, strformat, configuration, i18n
|
|||
from builtins import str as str_text
|
||||
|
||||
|
||||
class TextLogger (_Logger):
|
||||
class TextLogger(_Logger):
|
||||
"""
|
||||
A text logger, colorizing the output if possible.
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ def xmlquoteattr (s):
|
|||
return xml.sax.saxutils.escape(s, xmlattr_entities)
|
||||
|
||||
|
||||
class _XMLLogger (_Logger):
|
||||
class _XMLLogger(_Logger):
|
||||
"""Base class for XML output; easy to parse with any XML tool."""
|
||||
|
||||
def __init__ (self, **kwargs):
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class VirusCheck(_ContentPlugin):
|
|||
return config
|
||||
|
||||
|
||||
class ClamavError (Exception):
|
||||
class ClamavError(Exception):
|
||||
"""Raised on clamav errors."""
|
||||
pass
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ def get_sockinfo (host, port=None):
|
|||
return socket.getaddrinfo(host, port, family, socktype)
|
||||
|
||||
|
||||
class ClamavConfig (dict):
|
||||
class ClamavConfig(dict):
|
||||
"""Clamav configuration wrapper, with clamd connection method."""
|
||||
|
||||
def __init__ (self, filename):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Support for managing threads.
|
|||
import threading
|
||||
|
||||
|
||||
class StoppableThread (threading.Thread):
|
||||
class StoppableThread(threading.Thread):
|
||||
"""Thread class with a stop() method. The thread itself has to check
|
||||
regularly for the stopped() condition."""
|
||||
|
||||
|
|
|
|||
12
setup.py
12
setup.py
|
|
@ -95,7 +95,7 @@ def get_portable():
|
|||
return os.environ.get('LINKCHECKER_PORTABLE', '0')
|
||||
|
||||
|
||||
class MyInstallLib (install_lib):
|
||||
class MyInstallLib(install_lib):
|
||||
"""Custom library installation."""
|
||||
|
||||
def install (self):
|
||||
|
|
@ -155,7 +155,7 @@ class MyInstallLib (install_lib):
|
|||
return outs
|
||||
|
||||
|
||||
class MyInstallData (install_data):
|
||||
class MyInstallData(install_data):
|
||||
"""Fix file permissions."""
|
||||
|
||||
def run (self):
|
||||
|
|
@ -205,7 +205,7 @@ class MyInstallData (install_data):
|
|||
os.chmod(path, mode)
|
||||
|
||||
|
||||
class MyDistribution (Distribution):
|
||||
class MyDistribution(Distribution):
|
||||
"""Custom distribution class generating config file."""
|
||||
|
||||
def __init__ (self, attrs):
|
||||
|
|
@ -284,7 +284,7 @@ def check_manifest ():
|
|||
print('\nMissing: '.join(err))
|
||||
|
||||
|
||||
class MyBuild (build):
|
||||
class MyBuild(build):
|
||||
"""Custom build command."""
|
||||
|
||||
def run (self):
|
||||
|
|
@ -293,7 +293,7 @@ class MyBuild (build):
|
|||
build.run(self)
|
||||
|
||||
|
||||
class MyClean (clean):
|
||||
class MyClean(clean):
|
||||
"""Custom clean command."""
|
||||
|
||||
def run (self):
|
||||
|
|
@ -308,7 +308,7 @@ class MyClean (clean):
|
|||
clean.run(self)
|
||||
|
||||
|
||||
class MySdist (sdist):
|
||||
class MySdist(sdist):
|
||||
"""Custom sdist command."""
|
||||
|
||||
def get_file_list (self):
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ from builtins import str as str_text
|
|||
get_url_from = linkcheck.checker.get_url_from
|
||||
|
||||
|
||||
class TestLogger (linkcheck.logger._Logger):
|
||||
class TestLogger(linkcheck.logger._Logger):
|
||||
"""
|
||||
Output logger for automatic regression tests.
|
||||
"""
|
||||
|
|
@ -183,7 +183,7 @@ def get_test_aggregate (confargs, logargs, logger=TestLogger):
|
|||
return linkcheck.director.get_aggregate(config)
|
||||
|
||||
|
||||
class LinkCheckTest (unittest.TestCase):
|
||||
class LinkCheckTest(unittest.TestCase):
|
||||
"""
|
||||
Functional test class with ability to test local files.
|
||||
"""
|
||||
|
|
@ -273,7 +273,7 @@ class LinkCheckTest (unittest.TestCase):
|
|||
self.fail(os.linesep.join(l))
|
||||
|
||||
|
||||
class MailTest (LinkCheckTest):
|
||||
class MailTest(LinkCheckTest):
|
||||
"""Test mailto: link checking."""
|
||||
|
||||
def mail_valid (self, addr, **kwargs):
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from . import LinkCheckTest
|
|||
|
||||
TIMEOUT = 5
|
||||
|
||||
class FtpServerTest (LinkCheckTest):
|
||||
class FtpServerTest(LinkCheckTest):
|
||||
"""Start/stop an FTP server that can be used for testing."""
|
||||
|
||||
def __init__ (self, methodName='runTest'):
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ from . import LinkCheckTest
|
|||
from .. import get_file
|
||||
|
||||
|
||||
class StoppableHttpRequestHandler (SimpleHTTPRequestHandler):
|
||||
class StoppableHttpRequestHandler(SimpleHTTPRequestHandler):
|
||||
"""
|
||||
HTTP request handler with QUIT stopping the server.
|
||||
"""
|
||||
|
|
@ -55,7 +55,7 @@ StoppableHttpRequestHandler.extensions_map.update({
|
|||
})
|
||||
|
||||
|
||||
class StoppableHttpServer (HTTPServer):
|
||||
class StoppableHttpServer(HTTPServer):
|
||||
"""
|
||||
HTTP server that reacts to self.stop flag.
|
||||
"""
|
||||
|
|
@ -69,7 +69,7 @@ class StoppableHttpServer (HTTPServer):
|
|||
self.handle_request()
|
||||
|
||||
|
||||
class NoQueryHttpRequestHandler (StoppableHttpRequestHandler):
|
||||
class NoQueryHttpRequestHandler(StoppableHttpRequestHandler):
|
||||
"""
|
||||
Handler ignoring the query part of requests and sending dummy directory
|
||||
listings.
|
||||
|
|
@ -147,7 +147,7 @@ class NoQueryHttpRequestHandler (StoppableHttpRequestHandler):
|
|||
return f
|
||||
|
||||
|
||||
class HttpServerTest (LinkCheckTest):
|
||||
class HttpServerTest(LinkCheckTest):
|
||||
"""
|
||||
Start/stop an HTTP server that can be used for testing.
|
||||
"""
|
||||
|
|
@ -243,7 +243,7 @@ def get_cookie (maxage=2000):
|
|||
return "; ".join('%s="%s"' % (key, value) for key, value in data)
|
||||
|
||||
|
||||
class CookieRedirectHttpRequestHandler (NoQueryHttpRequestHandler):
|
||||
class CookieRedirectHttpRequestHandler(NoQueryHttpRequestHandler):
|
||||
"""Handler redirecting certain requests, and setting cookies."""
|
||||
|
||||
def end_headers (self):
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ from . import LinkCheckTest
|
|||
|
||||
TIMEOUT = 5
|
||||
|
||||
class TelnetServerTest (LinkCheckTest):
|
||||
class TelnetServerTest(LinkCheckTest):
|
||||
"""Start/stop a Telnet server that can be used for testing."""
|
||||
|
||||
def __init__ (self, methodName='runTest'):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test html anchor parsing and checking.
|
|||
from . import LinkCheckTest
|
||||
|
||||
|
||||
class TestAnchor (LinkCheckTest):
|
||||
class TestAnchor(LinkCheckTest):
|
||||
"""
|
||||
Test anchor checking of HTML pages.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test html <base> tag parsing.
|
|||
from . import LinkCheckTest
|
||||
|
||||
|
||||
class TestBase (LinkCheckTest):
|
||||
class TestBase(LinkCheckTest):
|
||||
"""
|
||||
Test links of base*.html files.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from .. import need_network, need_biplist
|
|||
import os
|
||||
|
||||
|
||||
class TestBookmarks (LinkCheckTest):
|
||||
class TestBookmarks(LinkCheckTest):
|
||||
"""
|
||||
Test bookmark link checking and content parsing.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test html <base> tag parsing.
|
|||
from . import LinkCheckTest
|
||||
|
||||
|
||||
class TestBase (LinkCheckTest):
|
||||
class TestBase(LinkCheckTest):
|
||||
"""
|
||||
Test, if charset encoding is done right.
|
||||
The linkchecker should translate the encoding
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Test error checking.
|
|||
from . import LinkCheckTest
|
||||
|
||||
|
||||
class TestError (LinkCheckTest):
|
||||
class TestError(LinkCheckTest):
|
||||
"""
|
||||
Test unrecognized or syntactically wrong links.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ def unzip (filename, targetdir):
|
|||
outfile.close()
|
||||
|
||||
|
||||
class TestFile (LinkCheckTest):
|
||||
class TestFile(LinkCheckTest):
|
||||
"""
|
||||
Test file:// link checking (and file content parsing).
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test html <frame> tag parsing.
|
|||
from . import LinkCheckTest
|
||||
|
||||
|
||||
class TestFrames (LinkCheckTest):
|
||||
class TestFrames(LinkCheckTest):
|
||||
"""
|
||||
Test link checking of HTML framesets.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from .. import need_pyftpdlib
|
|||
from .ftpserver import FtpServerTest
|
||||
|
||||
|
||||
class TestFtp (FtpServerTest):
|
||||
class TestFtp(FtpServerTest):
|
||||
"""Test ftp: link checking."""
|
||||
|
||||
@need_pyftpdlib
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import pytest
|
|||
from tests import need_network
|
||||
from .httpserver import HttpServerTest, CookieRedirectHttpRequestHandler
|
||||
|
||||
class TestHttp (HttpServerTest):
|
||||
class TestHttp(HttpServerTest):
|
||||
"""Test http:// link checking."""
|
||||
|
||||
def __init__(self, methodName='runTest'):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test http checking.
|
|||
from .httpserver import HttpServerTest
|
||||
from tests import need_network
|
||||
|
||||
class TestHttpMisc (HttpServerTest):
|
||||
class TestHttpMisc(HttpServerTest):
|
||||
"""Test http:// misc link checking."""
|
||||
|
||||
@need_network
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test http checking.
|
|||
from tests import need_network
|
||||
from .httpserver import HttpServerTest, CookieRedirectHttpRequestHandler
|
||||
|
||||
class TestHttpRedirect (HttpServerTest):
|
||||
class TestHttpRedirect(HttpServerTest):
|
||||
"""Test http:// link redirection checking."""
|
||||
|
||||
def __init__(self, methodName='runTest'):
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Test http checking.
|
|||
"""
|
||||
from .httpserver import HttpServerTest
|
||||
|
||||
class TestHttpRobots (HttpServerTest):
|
||||
class TestHttpRobots(HttpServerTest):
|
||||
"""Test robots.txt link checking behaviour."""
|
||||
|
||||
def test_html (self):
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Test http checking.
|
|||
"""
|
||||
from .httpserver import HttpServerTest, CookieRedirectHttpRequestHandler
|
||||
|
||||
class TestHttpsRedirect (HttpServerTest):
|
||||
class TestHttpsRedirect(HttpServerTest):
|
||||
"""Test https:// link redirection checking."""
|
||||
|
||||
def __init__(self, methodName='runTest'):
|
||||
|
|
@ -44,7 +44,7 @@ class TestHttpsRedirect (HttpServerTest):
|
|||
self.direct(url, resultlines, recursionlevel=0)
|
||||
|
||||
|
||||
class RedirectHttpsRequestHandler (CookieRedirectHttpRequestHandler):
|
||||
class RedirectHttpsRequestHandler(CookieRedirectHttpRequestHandler):
|
||||
|
||||
def redirect (self):
|
||||
"""Redirect request."""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import linkcheck.configuration
|
|||
from .__init__ import LinkCheckTest, get_url_from
|
||||
|
||||
|
||||
class TestInternpat (LinkCheckTest):
|
||||
class TestInternpat(LinkCheckTest):
|
||||
"""Test internal pattern."""
|
||||
|
||||
def test_trailing_slash (self):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test mail checking of bad mail addresses.
|
|||
from . import MailTest
|
||||
|
||||
|
||||
class TestMailBad (MailTest):
|
||||
class TestMailBad(MailTest):
|
||||
"""Test mailto: link checking."""
|
||||
|
||||
def test_error_mail (self):
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from tests import need_network
|
|||
from . import MailTest
|
||||
|
||||
|
||||
class TestMailGood (MailTest):
|
||||
class TestMailGood(MailTest):
|
||||
"""
|
||||
Test mailto: link checking.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from tests import need_network
|
|||
from . import LinkCheckTest
|
||||
|
||||
|
||||
class TestMisc (LinkCheckTest):
|
||||
class TestMisc(LinkCheckTest):
|
||||
"""
|
||||
Test misc link types.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ NNTP_TIMEOUT_SECS = 30
|
|||
|
||||
# disabled for now until some stable news server comes up
|
||||
@pytest.mark.skip(reason="disabled for now until some stable news server comes up")
|
||||
class TestNews (LinkCheckTest):
|
||||
class TestNews(LinkCheckTest):
|
||||
"""Test nntp: and news: link checking."""
|
||||
|
||||
def newstest (self, url, resultlines):
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from test.support import EnvironmentVarGuard
|
|||
|
||||
from . import httpserver
|
||||
|
||||
class TestProxy (httpserver.HttpServerTest):
|
||||
class TestProxy(httpserver.HttpServerTest):
|
||||
"""Test no_proxy env var handling."""
|
||||
|
||||
def test_noproxy (self):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test telnet checking.
|
|||
from .telnetserver import TelnetServerTest
|
||||
|
||||
|
||||
class TestTelnet (TelnetServerTest):
|
||||
class TestTelnet(TelnetServerTest):
|
||||
"""Test telnet: link checking."""
|
||||
|
||||
def test_telnet_error (self):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test checking of unknown URLs.
|
|||
from . import LinkCheckTest
|
||||
|
||||
|
||||
class TestUnknown (LinkCheckTest):
|
||||
class TestUnknown(LinkCheckTest):
|
||||
"""Test unknown URL scheme checking."""
|
||||
|
||||
def test_skype (self):
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from tests import need_network
|
|||
from . import LinkCheckTest
|
||||
|
||||
|
||||
class TestWhitespace (LinkCheckTest):
|
||||
class TestWhitespace(LinkCheckTest):
|
||||
"""
|
||||
Test whitespace in URLs.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ def get_file (filename=None):
|
|||
return str_text(directory)
|
||||
|
||||
|
||||
class TestConfig (unittest.TestCase):
|
||||
class TestConfig(unittest.TestCase):
|
||||
"""Test configuration parsing."""
|
||||
|
||||
def test_confparse (self):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import os
|
|||
from linkcheck.logger.csvlog import CSVLogger
|
||||
|
||||
|
||||
class TestCsvLogger (unittest.TestCase):
|
||||
class TestCsvLogger(unittest.TestCase):
|
||||
|
||||
def test_parts (self):
|
||||
args = dict(
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from wsgiref.util import setup_testing_defaults
|
|||
from linkcheck.lc_cgi import checkform, checklink, LCFormError, application
|
||||
from linkcheck.strformat import limit
|
||||
|
||||
class TestWsgi (unittest.TestCase):
|
||||
class TestWsgi(unittest.TestCase):
|
||||
"""Test wsgi application."""
|
||||
|
||||
def test_form_valid_url (self):
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from tests import need_clamav
|
|||
from linkcheck.plugins import viruscheck as clamav
|
||||
|
||||
|
||||
class TestClamav (unittest.TestCase):
|
||||
class TestClamav(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.clamav_conf = clamav.get_clamav_conf("/etc/clamav/clamd.conf")
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import unittest
|
|||
import linkcheck.director.console
|
||||
|
||||
|
||||
class TestConsole (unittest.TestCase):
|
||||
class TestConsole(unittest.TestCase):
|
||||
"""Test console operations."""
|
||||
|
||||
def test_internal_error (self):
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import unittest
|
|||
import linkcheck.containers
|
||||
|
||||
|
||||
class TestLFUCache (unittest.TestCase):
|
||||
class TestLFUCache(unittest.TestCase):
|
||||
"""Test LFU cache implementation."""
|
||||
|
||||
def setUp (self):
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import linkcheck.configuration
|
|||
import linkcheck.director
|
||||
|
||||
|
||||
class TestCookies (unittest.TestCase):
|
||||
class TestCookies(unittest.TestCase):
|
||||
"""Test cookie routines."""
|
||||
|
||||
def test_cookie_parse_multiple_headers (self):
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import unittest
|
|||
import linkcheck.decorators
|
||||
|
||||
|
||||
class TestDecorators (unittest.TestCase):
|
||||
class TestDecorators(unittest.TestCase):
|
||||
"""
|
||||
Test decorators.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import unittest
|
|||
import linkcheck.dummy
|
||||
|
||||
|
||||
class TestDummy (unittest.TestCase):
|
||||
class TestDummy(unittest.TestCase):
|
||||
"""
|
||||
Test dummy object.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from linkcheck.checker.fileurl import get_nt_filename
|
|||
from . import need_windows
|
||||
|
||||
|
||||
class TestFilenames (unittest.TestCase):
|
||||
class TestFilenames(unittest.TestCase):
|
||||
"""
|
||||
Test filename routines.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ file_existing = __file__
|
|||
file_non_existing = "ZZZ.i_dont_exist"
|
||||
|
||||
|
||||
class TestFileutil (unittest.TestCase):
|
||||
class TestFileutil(unittest.TestCase):
|
||||
"""Test file utility functions."""
|
||||
|
||||
def test_size (self):
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ patterns = (
|
|||
)
|
||||
|
||||
|
||||
class TestFtpparse (unittest.TestCase):
|
||||
class TestFtpparse(unittest.TestCase):
|
||||
"""
|
||||
Test FTP LIST line parsing.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ def run_with_options(options, cmd=linkchecker_cmd):
|
|||
run_checked([sys.executable, cmd] + options)
|
||||
|
||||
|
||||
class TestLinkchecker (unittest.TestCase):
|
||||
class TestLinkchecker(unittest.TestCase):
|
||||
"""Test the linkchecker commandline client."""
|
||||
|
||||
def test_linkchecker(self):
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import unittest
|
|||
from linkcheck.htmlutil import htmlsoup, linkparse
|
||||
|
||||
|
||||
class TestLinkparser (unittest.TestCase):
|
||||
class TestLinkparser(unittest.TestCase):
|
||||
"""
|
||||
Test link parsing.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import os
|
|||
from . import get_file
|
||||
import linkcheck.mimeutil
|
||||
|
||||
class TestMiMeutil (unittest.TestCase):
|
||||
class TestMiMeutil(unittest.TestCase):
|
||||
"""Test file utility functions."""
|
||||
|
||||
def mime_test (self, filename, mime_expected):
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from tests import need_network, need_linux
|
|||
from linkcheck.network import iputil
|
||||
|
||||
|
||||
class TestNetwork (unittest.TestCase):
|
||||
class TestNetwork(unittest.TestCase):
|
||||
"""Test network functions."""
|
||||
|
||||
@need_network
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ parsetests = [
|
|||
]
|
||||
|
||||
|
||||
class TestParser (unittest.TestCase):
|
||||
class TestParser(unittest.TestCase):
|
||||
"""
|
||||
Test html parser.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ def get_pofiles ():
|
|||
return pofiles
|
||||
|
||||
|
||||
class TestPo (unittest.TestCase):
|
||||
class TestPo(unittest.TestCase):
|
||||
"""Test .po file syntax."""
|
||||
|
||||
@need_posix
|
||||
|
|
@ -49,7 +49,7 @@ class TestPo (unittest.TestCase):
|
|||
self.assertEqual(ret, 0, msg="PO-file syntax error in %r" % f)
|
||||
|
||||
|
||||
class TestGTranslator (unittest.TestCase):
|
||||
class TestGTranslator(unittest.TestCase):
|
||||
"""GTranslator displays a middot · for a space. Unfortunately, it
|
||||
gets copied with copy-and-paste, what a shame."""
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from tests import need_network
|
|||
from linkcheck import configuration, robotparser2
|
||||
|
||||
|
||||
class TestRobotParser (unittest.TestCase):
|
||||
class TestRobotParser(unittest.TestCase):
|
||||
"""
|
||||
Test robots.txt parser (needs internet access).
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import unittest
|
|||
import linkcheck.robotparser2
|
||||
|
||||
|
||||
class TestRobotsTxt (unittest.TestCase):
|
||||
class TestRobotsTxt(unittest.TestCase):
|
||||
"""
|
||||
Test string formatting routines.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import time
|
|||
import linkcheck.strformat
|
||||
|
||||
|
||||
class TestStrFormat (unittest.TestCase):
|
||||
class TestStrFormat(unittest.TestCase):
|
||||
"""
|
||||
Test string formatting routines.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from tests import need_network
|
|||
import linkcheck.updater
|
||||
|
||||
|
||||
class TestUpdater (unittest.TestCase):
|
||||
class TestUpdater(unittest.TestCase):
|
||||
"""Test update check."""
|
||||
|
||||
@need_network
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ def url_norm (url, encoding="utf-8"):
|
|||
return linkcheck.url.url_norm(url, encoding=encoding)[0]
|
||||
|
||||
|
||||
class TestUrl (unittest.TestCase):
|
||||
class TestUrl(unittest.TestCase):
|
||||
"""Test url norming and quoting."""
|
||||
|
||||
def urlnormtest (self, url, nurl, encoding=None):
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ def get_test_aggregate ():
|
|||
return linkcheck.director.get_aggregate(config)
|
||||
|
||||
|
||||
class TestUrlBuild (unittest.TestCase):
|
||||
class TestUrlBuild(unittest.TestCase):
|
||||
"""
|
||||
Test url building.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue