aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'netlib/test.py')
-rw-r--r--netlib/test.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/netlib/test.py b/netlib/test.py
index 85a56739..2f6a7107 100644
--- a/netlib/test.py
+++ b/netlib/test.py
@@ -17,19 +17,18 @@ class ServerTestBase:
ssl = None
handler = None
addr = ("localhost", 0)
- use_ipv6 = False
@classmethod
def setupAll(cls):
cls.q = Queue.Queue()
s = cls.makeserver()
- cls.port = s.port
+ cls.port = s.address.port
cls.server = ServerThread(s)
cls.server.start()
@classmethod
def makeserver(cls):
- return TServer(cls.ssl, cls.q, cls.handler, cls.addr, cls.use_ipv6)
+ return TServer(cls.ssl, cls.q, cls.handler, cls.addr)
@classmethod
def teardownAll(cls):
@@ -41,16 +40,16 @@ class ServerTestBase:
class TServer(tcp.TCPServer):
- def __init__(self, ssl, q, handler_klass, addr, use_ipv6):
+ def __init__(self, ssl, q, handler_klass, addr):
"""
ssl: A {cert, key, v3_only} dict.
"""
- tcp.TCPServer.__init__(self, addr, use_ipv6=use_ipv6)
+ tcp.TCPServer.__init__(self, addr)
self.ssl, self.q = ssl, q
self.handler_klass = handler_klass
self.last_handler = None
- def handle_connection(self, request, client_address):
+ def handle_client_connection(self, request, client_address):
h = self.handler_klass(request, client_address, self)
self.last_handler = h
if self.ssl: