test we can pass an explicit websocket URL

This commit is contained in:
meejah 2021-04-18 21:14:28 -06:00
parent ade99eb8b3
commit dfd3bdd1a1

View File

@ -50,3 +50,21 @@ class Service(unittest.TestCase):
for s in services.services 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
)
)