From dff63335f212d32d7c1a4bb5276f2d31f5995ea1 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 22 Dec 2015 14:09:50 +0000 Subject: Import python-urllib3_1.13.1.orig.tar.gz --- dummyserver/testcase.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'dummyserver/testcase.py') diff --git a/dummyserver/testcase.py b/dummyserver/testcase.py index e5ae51b..f5588a0 100644 --- a/dummyserver/testcase.py +++ b/dummyserver/testcase.py @@ -42,10 +42,10 @@ class SocketDummyServerTestCase(unittest.TestCase): @classmethod def start_response_handler(cls, response, num=1, block_send=None): ready_event = threading.Event() + def socket_handler(listener): for _ in range(num): ready_event.set() - ready_event.clear() sock = listener.accept()[0] consume_socket(sock) @@ -61,9 +61,9 @@ class SocketDummyServerTestCase(unittest.TestCase): @classmethod def start_basic_handler(cls, **kw): return cls.start_response_handler( - b'HTTP/1.1 200 OK\r\n' - b'Content-Length: 0\r\n' - b'\r\n', **kw) + b'HTTP/1.1 200 OK\r\n' + b'Content-Length: 0\r\n' + b'\r\n', **kw) @classmethod def tearDownClass(cls): @@ -113,6 +113,17 @@ class HTTPSDummyServerTestCase(HTTPDummyServerTestCase): certs = DEFAULT_CERTS +class IPV6HTTPSDummyServerTestCase(HTTPSDummyServerTestCase): + host = '::1' + + @classmethod + def setUpClass(cls): + if not socket.has_ipv6: + raise SkipTest('IPv6 not available') + else: + super(IPV6HTTPSDummyServerTestCase, cls).setUpClass() + + class HTTPDummyProxyTestCase(unittest.TestCase): http_host = 'localhost' -- cgit v1.2.3