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')
|
self.assertEqual(e.args[0], 'timed out')
|
||||||
except socket.error, e:
|
except socket.error, e:
|
||||||
# unreachable is also a valid outcome
|
# unreachable is also a valid outcome
|
||||||
if e[0] != errno.EHOSTUNREACH:
|
if not e[0] in (errno.EHOSTUNREACH, errno.ENETUNREACH):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def test_accept_timeout(self):
|
def test_accept_timeout(self):
|
||||||
@@ -62,6 +62,7 @@ class TestGreenIo(LimitedTestCase):
|
|||||||
s.settimeout(0.1)
|
s.settimeout(0.1)
|
||||||
gs = greenio.GreenSocket(s)
|
gs = greenio.GreenSocket(s)
|
||||||
e = gs.connect_ex(('192.0.2.1', 80))
|
e = gs.connect_ex(('192.0.2.1', 80))
|
||||||
|
if not e in (errno.EHOSTUNREACH, errno.ENETUNREACH):
|
||||||
self.assertEquals(e, errno.EAGAIN)
|
self.assertEquals(e, errno.EAGAIN)
|
||||||
|
|
||||||
def test_recv_timeout(self):
|
def test_recv_timeout(self):
|
||||||
|
Reference in New Issue
Block a user