added appearing/disappearing box to test case

This commit is contained in:
Nickiel12 2024-05-30 11:45:50 -07:00
parent 420e0b327a
commit 55c61e99b4

View file

@ -9,12 +9,22 @@ async def handle_client(websocket, path):
print("packet connected") print("packet connected")
socket_connections[websocket] = "" socket_connections[websocket] = ""
internal_count = 0
show_4 = False
try: try:
while True: while True:
print("waiting for data") print("waiting for data")
data = await websocket.recv() data = await websocket.recv()
if data == "Type?": if data == "Type?":
await websocket.send("Automated") await websocket.send("Automated")
else:
internal_count += 1
if internal_count > 100:
show_4 = not show_4
internal_count = 1
if show_4:
await websocket.send("[1] 100:100 200:700\n[2] 250:250 750:750\n[3] 500:300 800:800\n[4] 50:150 300:600")
else: else:
await websocket.send("[1] 100:100 200:700\n[2] 250:250 750:750\n[3] 500:300 800:800") await websocket.send("[1] 100:100 200:700\n[2] 250:250 750:750\n[3] 500:300 800:800")
except websockets.exceptions.ConnectionClosed: except websockets.exceptions.ConnectionClosed: