(
app: ASGIApplication,
http_protocol_cls: type[HTTPProtocol],
lifespan: LifespanOff | LifespanOn | None = None,
**kwargs: Any,
)
| 262 | |
| 263 | |
| 264 | def get_connected_protocol( |
| 265 | app: ASGIApplication, |
| 266 | http_protocol_cls: type[HTTPProtocol], |
| 267 | lifespan: LifespanOff | LifespanOn | None = None, |
| 268 | **kwargs: Any, |
| 269 | ) -> MockProtocol: |
| 270 | loop = MockLoop() |
| 271 | transport = MockTransport() |
| 272 | config = Config(app=app, **kwargs) |
| 273 | lifespan = lifespan or LifespanOff(config) |
| 274 | server_state = ServerState() |
| 275 | protocol = http_protocol_cls(config=config, server_state=server_state, app_state=lifespan.state, _loop=loop) class="cm"># type: ignore |
| 276 | protocol.connection_made(transport) class="cm"># type: ignore[arg-type] |
| 277 | return protocol class="cm"># type: ignore[return-value] |
| 278 | |
| 279 | |
| 280 | async def test_get_request(http_protocol_cls: type[HTTPProtocol]): |
no test coverage detected