(url: str)
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected