(self)
| 250 | |
| 251 | @tests.util.retry_on_timeout |
| 252 | def testUDPReceiveQuery(self): |
| 253 | with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as listener: |
| 254 | listener.bind(("127.0.0.1", 0)) |
| 255 | with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sender: |
| 256 | sender.bind(("127.0.0.1", 0)) |
| 257 | q = dns.message.make_query("dns.google", dns.rdatatype.A) |
| 258 | dns.query.send_udp(sender, q, listener.getsockname()) |
| 259 | expiration = time.time() + 2 |
| 260 | (q, _, addr) = dns.query.receive_udp(listener, expiration=expiration) |
| 261 | self.assertEqual(addr, sender.getsockname()) |
| 262 | |
| 263 | |
| 264 | # for brevity |
nothing calls this directly
no test coverage detected