(
browser_factory: "Callable[..., asyncio.Future[Browser]]", server: Server
)
| 31 | |
| 32 | |
| 33 | async def test_should_use_proxy( |
| 34 | browser_factory: "Callable[..., asyncio.Future[Browser]]", server: Server |
| 35 | ) -> None: |
| 36 | server.set_route( |
| 37 | "/target.html", |
| 38 | lambda r: ( |
| 39 | r.write(b"<html><title>Served by the proxy</title></html>"), |
| 40 | r.finish(), |
| 41 | ), |
| 42 | ) |
| 43 | browser = await browser_factory(proxy={"server": f"localhost:{server.PORT}"}) |
| 44 | page = await browser.new_page() |
| 45 | await page.goto("http://non-existent.com/target.html") |
| 46 | assert await page.title() == "Served by the proxy" |
| 47 | |
| 48 | |
| 49 | async def test_proxy_should_allow_none_for_optional_settings( |
nothing calls this directly
no test coverage detected