Create a room via WebSocket and return the connection (kept alive).
(room_id: str)
| 111 | |
| 112 | |
| 113 | async def create_room_ws(room_id: str): |
| 114 | """Create a room via WebSocket and return the connection (kept alive).""" |
| 115 | ws = await websockets.connect(WS_URL) |
| 116 | await ws.send(json.dumps({ |
| 117 | "type": "create_room", |
| 118 | "room_id": room_id, |
| 119 | "device_id": f"test-{room_id}", |
| 120 | "device_type": "desktop", |
| 121 | "public_key": "dGVzdA==", |
| 122 | })) |
| 123 | resp = await asyncio.wait_for(ws.recv(), timeout=5) |
| 124 | data = json.loads(resp) |
| 125 | return ws, data |
| 126 | |
| 127 | |
| 128 | async def run_tests(): |