diff --git a/src/wormhole/_dilation/manager.py b/src/wormhole/_dilation/manager.py index ad74e92..feee725 100644 --- a/src/wormhole/_dilation/manager.py +++ b/src/wormhole/_dilation/manager.py @@ -97,7 +97,7 @@ class Manager(object): _reactor = attrib(repr=False) _eventual_queue = attrib(repr=False) _cooperator = attrib(repr=False) - _no_listen = False # TODO + _no_listen = attrib(default=False) _tor = None # TODO _timing = None # TODO _next_subchannel_id = None # initialized in choose_role @@ -466,6 +466,7 @@ class Dilator(object): _reactor = attrib() _eventual_queue = attrib() _cooperator = attrib() + _no_listen = attrib(default=False) def __attrs_post_init__(self): self._got_versions_d = Deferred() @@ -509,7 +510,7 @@ class Dilator(object): self._transit_key, self._transit_relay_location, self._reactor, self._eventual_queue, - self._cooperator) + self._cooperator, no_listen=self._no_listen) self._manager.start() while self._pending_inbound_dilate_messages: diff --git a/src/wormhole/test/dilate/test_manager.py b/src/wormhole/test/dilate/test_manager.py index e223a1c..ee31c5e 100644 --- a/src/wormhole/test/dilate/test_manager.py +++ b/src/wormhole/test/dilate/test_manager.py @@ -64,7 +64,7 @@ class TestDilator(unittest.TestCase): dil.got_wormhole_versions({"can-dilate": ["1"]}) # that should create the Manager self.assertEqual(ml.mock_calls, [mock.call(send, "us", transit_key, - None, reactor, eq, coop)]) + None, reactor, eq, coop, no_listen=False)]) # and tell it to start, and get wait-for-it-to-connect Deferred self.assertEqual(m.mock_calls, [mock.call.start(), mock.call.when_first_connected(), @@ -180,7 +180,7 @@ class TestDilator(unittest.TestCase): return_value="us"): dil.got_wormhole_versions({"can-dilate": ["1"]}) self.assertEqual(ml.mock_calls, [mock.call(send, "us", b"key", - None, reactor, eq, coop)]) + None, reactor, eq, coop, no_listen=False)]) self.assertEqual(m.mock_calls, [mock.call.start(), mock.call.rx_PLEASE(pleasemsg), mock.call.rx_HINTS(hintmsg), @@ -198,7 +198,7 @@ class TestDilator(unittest.TestCase): return_value="us"): dil.got_wormhole_versions({"can-dilate": ["1"]}) self.assertEqual(ml.mock_calls, [mock.call(send, "us", b"key", - relay, reactor, eq, coop), + relay, reactor, eq, coop, no_listen=False), mock.call().start(), mock.call().when_first_connected()])