Optional TCP_KEEPIDLE in unit tests

Allows to run unit tests on BSD-based platforms. The commit
da99c339 that solved the problem doesn't contain fixes of unit
tests.

Change-Id: Iff1771c1cbb37c30a888cd1da4fca5636e5797e7
This commit is contained in:
Ilya Kharin 2013-06-18 18:05:28 +04:00
parent f99cf2dcc1
commit 2a67003e77

View File

@ -235,10 +235,11 @@ class TestWSGI(unittest.TestCase):
socket.SO_REUSEADDR: 1,
socket.SO_KEEPALIVE: 1,
},
socket.IPPROTO_TCP: {
socket.TCP_KEEPIDLE: 600,
},
}
if hasattr(socket, 'TCP_KEEPIDLE'):
expected_socket_opts[socket.IPPROTO_TCP] = {
socket.TCP_KEEPIDLE: 600,
}
self.assertEquals(sock.opts, expected_socket_opts)
# test ssl
sock = wsgi.get_socket(ssl_conf)