From b98313ae23d82d22675e41feed0dac04470a172b Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Mon, 16 Oct 2023 20:33:46 +0200 Subject: [PATCH] add test for open close without any msg transfer --- system_tests/test_tcp_socket.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/system_tests/test_tcp_socket.py b/system_tests/test_tcp_socket.py index 6a06d6d..a50bb98 100644 --- a/system_tests/test_tcp_socket.py +++ b/system_tests/test_tcp_socket.py @@ -109,6 +109,24 @@ def ClientConnection(): yield s s.close() +def tempClientConnection(): + #host = '172.16.30.7' + host = 'logger.talent-monitoring.com' + #host = '127.0.0.1' + port = 5005 + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.connect((host, port)) + s.settimeout(1) + yield s + s.close() + +def test_open_close(): + try: + for s in tempClientConnection(): + pass + except: + assert False + assert True def test_send_contact_info1(ClientConnection, MsgContactInfo, MsgContactResp): s = ClientConnection