From dfd3bdd1a1a62eb86709e847bd3ea132f84962db Mon Sep 17 00:00:00 2001 From: meejah Date: Sun, 18 Apr 2021 21:14:28 -0600 Subject: [PATCH] test we can pass an explicit websocket URL --- .../test/test_service.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/wormhole_transit_relay/test/test_service.py b/src/wormhole_transit_relay/test/test_service.py index 23faed8..9ab30c8 100644 --- a/src/wormhole_transit_relay/test/test_service.py +++ b/src/wormhole_transit_relay/test/test_service.py @@ -50,3 +50,21 @@ class Service(unittest.TestCase): for s in services.services ) ) + + def test_websocket_explicit_url(self): + """ + A websocket factory is created with --websocket and + --websocket-url + """ + o = server_tap.Options() + o.parseOptions([ + "--websocket=tcp:4004", + "--websocket-url=ws://example.com:4004", + ]) + services = server_tap.makeService(o) + self.assertTrue( + any( + isinstance(s.factory, WebSocketServerFactory) + for s in services.services + ) + )