Commit 509d2d24 authored by Denis Bilenko's avatar Denis Bilenko

test__socket_dns.py: do not raise an error when getaddrinfo raises...

test__socket_dns.py: do not raise an error when getaddrinfo raises DNSError(66, 'unknown') instead of gaierror(-5, 'No address associated with hostname')
parent 52c1c40f
......@@ -8,7 +8,9 @@ from gevent.socket import *
ACCEPTED_GAIERROR_MISMATCH = {
"gaierror(-5, 'No address associated with hostname')": "DNSError(3, 'name does not exist')"}
"gaierror(-5, 'No address associated with hostname')":
("DNSError(3, 'name does not exist')", "DNSError(66, 'unknown')"),
}
assert gaierror is real_socket.gaierror
assert error is real_socket.error
......@@ -84,7 +86,7 @@ class TestCase(greentest.TestCase):
if isinstance(a, Exception) and isinstance(b, Exception):
if repr(a) == repr(b):
return True
if ACCEPTED_GAIERROR_MISMATCH.get(repr(a), repr(b)) == repr(b):
if repr(b) in ACCEPTED_GAIERROR_MISMATCH.get(repr(a), (repr(b), )):
return True
def checkEqual(self, a, b):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment