+
+
+class FakeFetcher(Fetcher):
+
+ def __init__(self, resources: dict[str, bytes]) -> None:
+ self._resources = resources
+
+ def fetch(self, url: str) -> bytes:
+ if url not in self._resources:
+ raise requests.HTTPError("URL not found")
+ return self._resources[url]