X-Git-Url: http://git.scottworley.com/paperdoorknob/blobdiff_plain/75c5665e089279f9de1a38b31e03f9736ecdc17e..30b145cc4660ae5d86bd0de88e373d3107ba54d5:/fetch_test.py diff --git a/fetch_test.py b/fetch_test.py index 5f21fee..59a1514 100644 --- a/fetch_test.py +++ b/fetch_test.py @@ -45,7 +45,10 @@ class TestFetch(unittest.TestCase): def testCacheHitRateReport(self) -> None: buf = StringIO() - with CachingFetcher("testcachehitratereportwithcl", TIMEOUT, buf) as f: + + def log(msg: str) -> None: + print(msg, file=buf) + with CachingFetcher("testcachehitratereportwithcl", TIMEOUT, log) as f: for _ in range(7): f.fetch(f"http://localhost:{self._port}") self.assertEqual("Fetch cache hits: 6 (85.7%)\n", buf.getvalue())