| 13 | |
| 14 | class MockContext(BasicCrawlingContext): |
| 15 | def __init__(self, *, label: str | None) -> None: |
| 16 | super().__init__( |
| 17 | request=Request.from_url(url='https://example.com/', user_data={'label': label}), |
| 18 | session=Session(), |
| 19 | send_request=AsyncMock(), |
| 20 | add_requests=AsyncMock(), |
| 21 | proxy_info=AsyncMock(), |
| 22 | push_data=AsyncMock(), |
| 23 | use_state=AsyncMock(), |
| 24 | get_key_value_store=AsyncMock(), |
| 25 | log=logging.getLogger(), |
| 26 | register_deferred_cleanup=lambda _: None, |
| 27 | ) |
| 28 | |
| 29 | |
| 30 | async def test_router_no_handlers() -> None: |