Skip to content

Commit 14a1d9a

Browse files
committed
Added static unit test responses
1 parent df0062e commit 14a1d9a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/labthings/server/default_views/sockets.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import logging
66

77

8+
STATIC_SOCKET_RESPONSES = {
9+
"__unittest": "__unittest_response"
10+
}
11+
812
def socket_handler(ws):
913
# Create a socket subscriber
1014
wssub = SocketSubscriber(ws)
@@ -26,6 +30,7 @@ def socket_handler(ws):
2630

2731
def process_socket_message(message: str):
2832
if message:
29-
return None
33+
if message in STATIC_SOCKET_RESPONSES:
34+
return STATIC_SOCKET_RESPONSES.get(message)
3035
else:
3136
return None

0 commit comments

Comments
 (0)