Skip to content

Commit 1c2357d

Browse files
committed
update test
1 parent 1c46e23 commit 1c2357d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/test_asyncio.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,12 +974,14 @@ async def test_legacy_unicast_response(run_isolated):
974974
query = DNSOutgoing(const._FLAGS_QR_QUERY, multicast=False, id_=888)
975975
question = DNSQuestion(info.type, const._TYPE_PTR, const._CLASS_IN)
976976
query.add_question(question)
977+
protocol = aiozc.zeroconf.engine.protocols[0]
977978

978979
with patch.object(aiozc.zeroconf, "async_send") as send_mock:
979-
aiozc.zeroconf.engine.protocols[0].datagram_received(query.packets()[0], ('127.0.0.1', 6503))
980+
protocol.datagram_received(query.packets()[0], ('127.0.0.1', 6503))
980981

981982
calls = send_mock.mock_calls
982-
assert calls == [call(ANY, '127.0.0.1', 6503, (), ANY)]
983+
# Verify the response is sent back on the socket it was recieved from
984+
assert calls == [call(ANY, '127.0.0.1', 6503, (), protocol.transport)]
983985
outgoing = send_mock.call_args[0][0]
984986
assert isinstance(outgoing, DNSOutgoing)
985987
assert outgoing.questions == [question]

0 commit comments

Comments
 (0)