From 9111b6e595bf2c3fd57fd4478bb61493a6b686e6 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Fri, 10 Feb 2023 10:14:58 +0100 Subject: [PATCH] and another attempt fixing ctests --- tnc/test2.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tnc/test2.py b/tnc/test2.py index e69de29b..29754791 100644 --- a/tnc/test2.py +++ b/tnc/test2.py @@ -0,0 +1,24 @@ +import sock +import threading +import ujson as json + + +received_json =b'{"type": "command", "command": "start_beacon", "parameter": "5"}' + +sock.TESTMODE = True +#sock.ThreadedTCPRequestHandler.process_tnc_commands(None, received_json) + +#testserver = sock.ThreadedTCPServer(('127.0.0.1', 3000), sock.ThreadedTCPRequestHandler).serve_forever +#server_thread = threading.Thread(target=testserver.serve_forever) +#server_thread.daemon = True +#server_thread.start() + + +#test = sock.ThreadedTCPRequestHandler(request=sock.ThreadedTCPServer, client_address='127.0.0.1', server=None) + +#sock.process_tnc_commands(received_json) +sock.ThreadedTCPRequestHandler.process_tnc_commands(None, received_json) + + + +print("done") \ No newline at end of file