Don't use default values in configuration tests

This commit is contained in:
Chris Mayo 2022-09-20 19:36:42 +01:00
parent 6dc5ade29d
commit 0c59cd5c1e
2 changed files with 4 additions and 2 deletions

View file

@ -15,7 +15,7 @@ maxnumurls=1000
maxrunseconds=1
maxfilesizeparse=100
maxfilesizedownload=100
resultcachesize=100000
resultcachesize=9999
[filtering]
ignore=

View file

@ -34,6 +34,8 @@ class TestConfig(unittest.TestCase):
"""Test configuration parsing."""
def test_confparse(self):
# Tests must either cover every possiblity or
# use a value other than the default
config = linkcheck.configuration.Configuration()
files = [get_file("config0.ini")]
config.read(files)
@ -55,7 +57,7 @@ class TestConfig(unittest.TestCase):
self.assertEqual(config["maxrunseconds"], 1)
self.assertEqual(config["maxfilesizeparse"], 100)
self.assertEqual(config["maxfilesizedownload"], 100)
self.assertEqual(config["resultcachesize"], 100000)
self.assertEqual(config["resultcachesize"], 9999)
# filtering section
patterns = [x["pattern"].pattern for x in config["externlinks"]]
for prefix in ("ignore_", "nofollow_"):