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())