Generate room codes, python test script

This commit is contained in:
2022-09-29 15:28:38 -05:00
parent 23342c89ec
commit 09c5fe3d8b
4 changed files with 66 additions and 5 deletions

14
test/test.py Normal file
View File

@@ -0,0 +1,14 @@
import asyncio
import websockets
import re
async def test():
async with websockets.connect("ws://localhost:8080") as ws:
response = await ws.recv()
assert(response == "HOSTJOIN:")
await ws.send("HOST:")
response = await ws.recv()
assert(re.match(r"(\d|[a-f]){6}", response))
asyncio.get_event_loop().run_until_complete(test())
print("All tests passed")