diff --git a/tests/test_udp_client.py b/tests/test_udp_client.py index 04e959f..6fdd04b 100755 --- a/tests/test_udp_client.py +++ b/tests/test_udp_client.py @@ -1,18 +1,15 @@ #!/usr/bin/env python3 import json -import socket import struct -import threading -import time -import unittest import pytest -from unittest.mock import * +from unittest.mock import Mock from blueye.protocol import UdpClient UDP_PORT = 32011 -fake_json = json.loads(""" +fake_json = json.loads( + """ [ { "version": "2", @@ -56,74 +53,39 @@ ] } ] -""") +""" +) -class UDPServer(threading.Thread): - def __init__(self): - threading.Thread.__init__(self) - self.daemon = True - self._stop_loop = False - self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - self._addr = ("127.0.0.1", UDP_PORT) - self._msg2 = struct.pack("