(ws: WebSocketRoute)
| 352 | log: list[str] = [] |
| 353 | |
| 354 | async def handle_ws(ws: WebSocketRoute) -> None: |
| 355 | def on_message(message: Union[str, bytes]) -> None: |
| 356 | assert isinstance(message, str) |
| 357 | log.append(message) |
| 358 | ws.send("response") |
| 359 | |
| 360 | ws.on_message(on_message) |
| 361 | |
| 362 | # No trailing slash in the route pattern |
| 363 | await page.route_web_socket(f"ws://localhost:{server.PORT}", handle_ws) |
nothing calls this directly
no test coverage detected