Generate room codes, python test script
This commit is contained in:
14
test/test.py
Normal file
14
test/test.py
Normal 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")
|
||||
Reference in New Issue
Block a user