]> git.scottworley.com Git - paperdoorknob/blobdiff - fetch.py
ImageStore
[paperdoorknob] / fetch.py
index 7776f93085943ef8f04948858eeadb0d69323d86..d5267534a100e1d0e527ef347547cb57b2ae6f31 100644 (file)
--- a/fetch.py
+++ b/fetch.py
@@ -47,8 +47,13 @@ class FakeFetcher(Fetcher):
 
     def __init__(self, resources: dict[str, bytes]) -> None:
         self._resources = resources
 
     def __init__(self, resources: dict[str, bytes]) -> None:
         self._resources = resources
+        self._fetch_count = 0
 
     def fetch(self, url: str) -> bytes:
 
     def fetch(self, url: str) -> bytes:
+        self._fetch_count += 1
         if url not in self._resources:
             raise requests.HTTPError("URL not found")
         return self._resources[url]
         if url not in self._resources:
             raise requests.HTTPError("URL not found")
         return self._resources[url]
+
+    def request_count(self) -> int:
+        return self._fetch_count