Commit 35712c2c by Julien Muchembled

WSGI: fix getServerAddress() in tests

parent fe06db19
......@@ -144,7 +144,10 @@ def createServer(application, logger, **kw):
if not hasattr(server, 'addr'):
server.addr = server.adj.listen[0][3]
server.addr = kw['sockets'][0].getsockname()
except KeyError:
server.addr = server.adj.listen[0][3]
elif not server.addr:
server.addr = server.sockinfo[3]
return server
......@@ -98,8 +98,9 @@ class TestInvalidationBug(ERP5TypeTestCase):
activity_tool = self.portal.portal_activities
node_list = list(activity_tool.getProcessingNodeList())
assert node_list and isinstance(storage, ClientStorage), \
"this unit test must be run with at least 2 ZEO clients"
assert node_list and isinstance(storage, ClientStorage), (
node_list, storage,
"this unit test must be run with at least 2 ZEO clients")
### Prepare unit test, to minimize amount of work during critical section
## make sure activity tool's OOBTree for family mapping is loaded before the test
......@@ -166,7 +166,8 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
webdav_ports = ()
ZopeTestCase._print(message % (server_type, ip, port))
if verbose:
ZopeTestCase._print(message % (server_type, ip, port))
if webdav_ports:
server_type = 'WebDAV'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment