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

Function testResolverNoNameservers

tests/test_resolver.py:1206–1221  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1204 reason="Internet and NanoAuth required",
1205)
1206def testResolverNoNameservers():
1207 with FormErrNanoNameserver() as na:
1208 res = dns.resolver.Resolver(configure=False)
1209 res.port = na.udp_address[1]
1210 res.nameservers = [na.udp_address[0]]
1211 try:
1212 a = res.resolve("www.dnspython.org")
1213 assert False # should never happen
1214 except dns.resolver.NoNameservers as e:
1215 errors = e.kwargs["errors"]
1216 assert len(errors) == 1
1217 for error in errors:
1218 assert error[0] == f"Do53:{na.udp_address[0]}@{na.udp_address[1]}"
1219 assert not error[1] # not TCP
1220 assert error[2] == na.udp_address[1] # port
1221 assert error[3] == "FORMERR"
1222
1223
1224class SlowAlwaysType3NXDOMAINNanoNameserver(Server):

Callers

nothing calls this directly

Calls 2

resolveMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…