mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-17 23:08:21 +00:00
tor_provider.get_listener(): return a real endpoint, instead of a descriptor
get_listener() is allowed to return either, and the Tor provider is currently simple enough to not really need more than a basic descriptor, but have it return a full Endpoint for use as an example of what I2P can do later.
This commit is contained in:
@ -408,8 +408,13 @@ class ProviderListener(unittest.TestCase):
|
||||
p = tor_provider.Provider("basedir",
|
||||
FakeConfig(**{"onion.local_port": "321"}),
|
||||
reactor)
|
||||
fake_ep = object()
|
||||
with mock.patch("allmydata.util.tor_provider.TCP4ServerEndpoint",
|
||||
return_value=fake_ep) as e:
|
||||
endpoint_or_description = p.get_listener()
|
||||
self.assertEqual(endpoint_or_description, "tcp:321:interface=127.0.0.1")
|
||||
self.assertIs(endpoint_or_description, fake_ep)
|
||||
self.assertEqual(e.mock_calls, [mock.call(reactor, 321,
|
||||
interface="127.0.0.1")])
|
||||
|
||||
class Provider_CheckOnionConfig(unittest.TestCase):
|
||||
def test_default(self):
|
||||
|
Reference in New Issue
Block a user