Merge pull request #393 from cjmayo/tidyten10

Assorted test tidy-ups
This commit is contained in:
Chris Mayo 2020-05-18 19:16:44 +01:00 committed by GitHub
commit ce0a151c8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 13 deletions

View file

@ -33,7 +33,7 @@ class TestHttpMetaRobots(HttpServerTest):
"""Test <meta name="robots" content="nofollow"> using http."""
def test_http_meta_robots(self):
url = "http://localhost:%d/tests/checker/data/norobots.html" % self.port
url = self.get_url("norobots.html")
resultlines = [
"url %s" % url,
"cache key %s" % url,

View file

@ -17,8 +17,6 @@
Test http checking.
"""
import pytest
from tests import need_network
from .httpserver import HttpServerTest, CookieRedirectHttpRequestHandler

View file

@ -48,8 +48,7 @@ class TestHttpRedirect(HttpServerTest):
self.direct(url, resultlines, recursionlevel=0)
def redirect2(self):
url = "http://localhost:%d/tests/checker/data/redirect.html" % \
self.port
url = self.get_url("redirect.html")
nurl = url
rurl = url.replace("redirect", "newurl")
resultlines = [

View file

@ -1,4 +1,3 @@
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2005 Joe Wreschnig
# Copyright (C) 2005-2010 Bastian Kleineidam
#
@ -50,7 +49,7 @@ class TestPo(unittest.TestCase):
class TestGTranslator(unittest.TestCase):
"""GTranslator displays a middot · for a space. Unfortunately, it
"""GTranslator displays a middot · for a space. Unfortunately, it
gets copied with copy-and-paste, what a shame."""
def test_gtranslator(self):

View file

@ -99,7 +99,6 @@ class TestStrFormat(unittest.TestCase):
def test_is_ascii(self):
self.assertTrue(linkcheck.strformat.is_ascii("abcd./"))
self.assertTrue(not linkcheck.strformat.is_ascii("ä"))
self.assertTrue(not linkcheck.strformat.is_ascii("ä"))
def test_indent(self):
s = "bla"
@ -165,7 +164,6 @@ class TestStrFormat(unittest.TestCase):
def test_unicode_safe(self):
unicode_safe = linkcheck.strformat.unicode_safe
self.assertEqual(unicode_safe("a"), "a")
self.assertEqual(unicode_safe("a"), "a")
def test_ascii_safe(self):
ascii_safe = linkcheck.strformat.ascii_safe
@ -175,10 +173,6 @@ class TestStrFormat(unittest.TestCase):
def test_strip_control_chars(self):
strip = linkcheck.strformat.strip_control_chars
self.assertEqual(strip(""), "")
self.assertEqual(strip(""), "")
self.assertEqual(strip("a"), "a")
self.assertEqual(strip("a"), "a")
self.assertEqual(strip("ä"), "ä")
self.assertEqual(strip("ä"), "ä")
self.assertEqual(strip("\x01"), "")
self.assertEqual(strip("\x01"), "")