Commit 35712c2c authored by Julien Muchembled's avatar Julien Muchembled

WSGI: fix getServerAddress() in tests

parent fe06db19
......@@ -144,7 +144,10 @@ def createServer(application, logger, **kw):
**kw
)
if not hasattr(server, 'addr'):
server.addr = server.adj.listen[0][3]
try:
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())
node_list.remove(getCurrentNode())
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):
else:
webdav_ports = ()
sockets.append(s)
ZopeTestCase._print(message % (server_type, ip, port))
if verbose:
ZopeTestCase._print(message % (server_type, ip, port))
if webdav_ports:
break
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 to comment