(
config: Config,
http_protocol_cls: type[HTTPProtocol],
)
| 162 | |
| 163 | |
| 164 | def get_connected_protocol( |
| 165 | config: Config, |
| 166 | http_protocol_cls: type[HTTPProtocol], |
| 167 | ) -> MockProtocol: |
| 168 | loop = MockLoop() |
| 169 | transport = MockTransport() |
| 170 | lifespan = LifespanOff(config) |
| 171 | server_state = ServerState() |
| 172 | protocol = http_protocol_cls(config=config, server_state=server_state, app_state=lifespan.state, _loop=loop) # type: ignore |
| 173 | protocol.connection_made(transport) # type: ignore[arg-type] |
| 174 | return protocol # type: ignore[return-value] |