X-Git-Url: http://git.scottworley.com/paperdoorknob/blobdiff_plain/e10b5b6f112c057ab33ad46f8a3385d3bcd23e1d..91fe9916122adaee2cf1695040f906d709e1aa1c:/fetch.py diff --git a/fetch.py b/fetch.py index 7776f93..d526753 100644 --- a/fetch.py +++ b/fetch.py @@ -47,8 +47,13 @@ class FakeFetcher(Fetcher): def __init__(self, resources: dict[str, bytes]) -> None: self._resources = resources + self._fetch_count = 0 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] + + def request_count(self) -> int: + return self._fetch_count