(config: Config, ws_protocol_cls: WSProtocolClass)
| 31 | |
| 32 | |
| 33 | def get_connected_ws_protocol(config: Config, ws_protocol_cls: WSProtocolClass) -> Any: |
| 34 | loop = MockLoop() |
| 35 | transport = MockTransport() |
| 36 | lifespan = LifespanOff(config) |
| 37 | server_state = ServerState() |
| 38 | protocol = ws_protocol_cls(config=config, server_state=server_state, app_state=lifespan.state, _loop=loop) # type: ignore[arg-type] |
| 39 | protocol.connection_made(transport) # type: ignore[arg-type] |
| 40 | return protocol |