Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions test/test_udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

from src.connect_udp import UDP

UDP_BROADCAST_PORT = 65030


def test_udp_server_init(udp_server):
assert udp_server.port > 0
Expand Down Expand Up @@ -50,12 +48,12 @@ def on_msg(data, addr):
def test_udp_broadcast():
received = threading.Event()

s1 = UDP("0.0.0.0", UDP_BROADCAST_PORT)
s1 = UDP("0.0.0.0", 0)
s1.listen(lambda data, addr: received.set())

c = UDP("0.0.0.0")
try:
c.broadcast(b"/probe", UDP_BROADCAST_PORT)
c.broadcast(b"/probe", s1.port)
assert received.wait(timeout=2), "did not receive broadcast"
finally:
c.close()
Expand Down
Loading