MCPcopy Create free account
hub / github.com/rthalley/dnspython / testQueryUDP

Method testQueryUDP

tests/test_async.py:330–345  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

328
329 @tests.util.retry_on_timeout
330 def testQueryUDP(self):
331 for address in query_addresses:
332 qname = dns.name.from_text("dns.google.")
333
334 async def run():
335 q = dns.message.make_query(qname, dns.rdatatype.A)
336 return await dns.asyncquery.udp(q, address, timeout=2)
337
338 response = self.async_run(run)
339 rrs = response.get_rrset(
340 response.answer, qname, dns.rdataclass.IN, dns.rdatatype.A
341 )
342 self.assertTrue(rrs is not None)
343 seen = set([rdata.address for rdata in rrs])
344 self.assertTrue("8.8.8.8" in seen)
345 self.assertTrue("8.8.4.4" in seen)
346
347 @tests.util.retry_on_timeout
348 def testQueryUDPWithSocket(self):

Callers

nothing calls this directly

Calls 3

async_runMethod · 0.95
from_textMethod · 0.45
get_rrsetMethod · 0.45

Tested by

no test coverage detected