fix test_connect_timeout and test_connect_ex_timeout so they ignore errno.EHOSTUNREACH *and* errno.ENETUNREACH
This commit is contained in:
@@ -40,7 +40,7 @@ class TestGreenIo(LimitedTestCase):
|
||||
self.assertEqual(e.args[0], 'timed out')
|
||||
except socket.error, e:
|
||||
# unreachable is also a valid outcome
|
||||
if e[0] != errno.EHOSTUNREACH:
|
||||
if not e[0] in (errno.EHOSTUNREACH, errno.ENETUNREACH):
|
||||
raise
|
||||
|
||||
def test_accept_timeout(self):
|
||||
@@ -62,7 +62,8 @@ class TestGreenIo(LimitedTestCase):
|
||||
s.settimeout(0.1)
|
||||
gs = greenio.GreenSocket(s)
|
||||
e = gs.connect_ex(('192.0.2.1', 80))
|
||||
self.assertEquals(e, errno.EAGAIN)
|
||||
if not e in (errno.EHOSTUNREACH, errno.ENETUNREACH):
|
||||
self.assertEquals(e, errno.EAGAIN)
|
||||
|
||||
def test_recv_timeout(self):
|
||||
listener = greenio.GreenSocket(socket.socket())
|
||||
|
Reference in New Issue
Block a user