'Test write points UDP for TestInfluxDBClient object.'

def test_write_points_udp(self):

    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    port = random.randint(4000, 8000)
    s.bind(('0.0.0.0', port))
    cli = InfluxDBClient('localhost', 8086, 'root', 'root', 'test', use_udp=True, udp_port=port)
    cli.write_points(self.dummy_points)
    (received_data, addr) = s.recvfrom(1024)
    self.assertEqual(self.dummy_points, json.loads(received_data.decode(), strict=True))
