Add UDP socket tests
This commit is contained in:
parent
29d49dfeb2
commit
116ee89390
1 changed files with 15 additions and 0 deletions
15
main.py
15
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:
|
||||
|
|
Loading…
Reference in a new issue