Commit ae6112d7 authored by Tres Seaver's avatar Tres Seaver

Whitespace for clarity.

parent 6d8066d5
...@@ -464,24 +464,30 @@ class ApplicationManagerTests(ConfigTestBase, ...@@ -464,24 +464,30 @@ class ApplicationManagerTests(ConfigTestBase,
def test_getServers(self): def test_getServers(self):
from asyncore import socket_map from asyncore import socket_map
class DummySocketServer: class DummySocketServer:
def __init__(self, port): def __init__(self, port):
self.port = port self.port = port
class AnotherSocketServer(DummySocketServer): class AnotherSocketServer(DummySocketServer):
pass pass
class NotAServer: class NotAServer:
pass pass
am = self._makeOne() am = self._makeOne()
_old_socket_map = socket_map.copy() _old_socket_map = socket_map.copy()
socket_map.clear() socket_map.clear()
socket_map['foo'] = DummySocketServer(45) socket_map['foo'] = DummySocketServer(45)
socket_map['bar'] = AnotherSocketServer(57) socket_map['bar'] = AnotherSocketServer(57)
socket_map['qux'] = NotAServer() socket_map['qux'] = NotAServer()
try: try:
pairs = am.getServers() pairs = am.getServers()
finally: finally:
socket_map.clear() socket_map.clear()
socket_map.update(_old_socket_map) socket_map.update(_old_socket_map)
self.assertEqual(len(pairs), 2) self.assertEqual(len(pairs), 2)
self.failUnless((str(DummySocketServer), 'Port: 45') in pairs) self.failUnless((str(DummySocketServer), 'Port: 45') in pairs)
self.failUnless((str(AnotherSocketServer), 'Port: 57') in pairs) self.failUnless((str(AnotherSocketServer), 'Port: 57') in pairs)
......
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