MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / fake_http_get_bytes

Function fake_http_get_bytes

tests/test_fetch_pdf.py:31–37  ·  view source on GitHub ↗
(url: str)

Source from the content-addressed store, hash-verified

29 requested_urls: list[str] = []
30
31 def fake_http_get_bytes(url: str) -> bytes:
32 requested_urls.append(url)
33 if url == "https://doi.org/10.3389/fpubh.2019.00399":
34 return b"<html>not a pdf</html>"
35 if url == "https://www.frontiersin.org/articles/10.3389/fpubh.2019.00399/pdf":
36 return b"%PDF-1.7\nbody"
37 raise AssertionError(f"unexpected url: {url}")
38
39 monkeypatch.setattr("fetch_pdf.http_get_bytes", fake_http_get_bytes)
40

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected