Merge pull request #667 from cjmayo/resultcachesize

Fixed a bug where the resultcachesize setting was ignored.
This commit is contained in:
Chris Mayo 2022-09-22 19:23:03 +01:00 committed by GitHub
commit 61792cb879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View file

@ -187,6 +187,7 @@ class LCConfigParser(RawConfigParser):
except ValueError:
self.read_string_option(section, "sslverify")
self.read_int_option(section, "maxrunseconds", min=0)
self.read_int_option(section, "resultcachesize", min=0)
def read_authentication_config(self):
"""Read configuration options in section "authentication"."""

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_"):