From 116ee8939044c0b6cd7652e020ca894710a8e626 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Fri, 31 May 2024 19:27:07 +0400 Subject: [PATCH] Add UDP socket tests --- main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main.py b/main.py index d454829..a3a8020 100644 --- a/main.py +++ b/main.py @@ -33,6 +33,21 @@ class TestTCP(TestCase): self.sock.close() +class TestUDP(TestCase): + + def setUp(self) -> None: + self.sock = socket.socket(type=socket.SOCK_DGRAM) + + def test_nm(self) -> None: + self.sock.sendto(device.nm_req_data().encode(), UDP_ADDR) + # aaand we can not check if server accepted the data + # so this TestCase is absolutely useless + # until client API is implemented + + def test_json(self) -> None: + self.sock.sendto(device.json_req_data().encode(), UDP_ADDR) + + class TestHTTP(TestCase): def test_get(self) -> None: