X-Git-Url: http://git.scottworley.com/paperdoorknob/blobdiff_plain/75c5665e089279f9de1a38b31e03f9736ecdc17e..62043b2bafbcb57beae7559235bd6984b6275b55:/fetch_test.py?ds=inline 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())