From 7d72d49eec786a6f0f0f420ea9653810c9e8930a Mon Sep 17 00:00:00 2001 From: James Sully Date: Wed, 31 Jul 2024 18:31:22 +1000 Subject: [PATCH] make the trivial test an actual test --- test_daemon.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test_daemon.py b/test_daemon.py index ad1ef1d..e390183 100755 --- a/test_daemon.py +++ b/test_daemon.py @@ -75,9 +75,19 @@ def run_client_tests(): client_sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) client_sock.connect(SOCKET_PATH) - client_sock.send(b'"list"') + + # test list + msg = b'"list"' + client_sock.send(msg) response = client_sock.recv(1024) - print(f"-- Received response: {response}") + expected = b'{"ok": {"timers": []}}' + if response != expected: + print(f"sent: {msg}") + print(f"expected: {expected}") + print(f"received: {response}") + sys.exit(1) + + print("All tests passed") client_sock.close() if __name__ == "__main__":