From ca06e95bbde0219a9bfd7234079461cfdd85fe8a Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 27 Feb 2016 17:29:04 -0800 Subject: [PATCH] test_blocking: avoid using real hints --- src/wormhole/test/test_blocking.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/wormhole/test/test_blocking.py b/src/wormhole/test/test_blocking.py index 60dc6f7..1fbfaff 100644 --- a/src/wormhole/test/test_blocking.py +++ b/src/wormhole/test/test_blocking.py @@ -449,6 +449,11 @@ class EventSourceClient(unittest.TestCase): ]) class Transit(_DoBothMixin, ServerBase, unittest.TestCase): + def test_hints(self): + r = TransitReceiver(self.transit) + hints = r.get_direct_hints() + self.assertTrue(len(hints), hints) + @inlineCallbacks def test_direct_to_receiver(self): s = TransitSender(self.transit) @@ -457,7 +462,9 @@ class Transit(_DoBothMixin, ServerBase, unittest.TestCase): # force the connection to be sender->receiver s.set_transit_key(key) - s.add_their_direct_hints(r.get_direct_hints()) + # only use 127.0.0.1 + hint = u"tcp:127.0.0.1:%d" % r.listener.server_address[1] + s.add_their_direct_hints([hint]) s.add_their_relay_hints([]) r.set_transit_key(key) r.add_their_direct_hints([]) @@ -483,7 +490,8 @@ class Transit(_DoBothMixin, ServerBase, unittest.TestCase): s.add_their_direct_hints([]) s.add_their_relay_hints([]) r.set_transit_key(key) - r.add_their_direct_hints(s.get_direct_hints()) + hint = u"tcp:127.0.0.1:%d" % s.listener.server_address[1] + r.add_their_direct_hints([hint]) r.add_their_relay_hints([]) (sp, rp) = yield self.doBoth([s.connect], [r.connect])