Example #1
0
 def test_make_websocket_url_without_base_url(self):
     wcommon = WebServiceCommon(reactor=the_reactor,
                                title='',
                                ws_endpoint_string='tcp:1234')
     request = FakeRequest()
     self.assertEqual('ws://fake-request-hostname:1234/testpath',
                      wcommon.make_websocket_url(request, '/testpath'))
Example #2
0
 def test_make_websocket_url_with_base_url_with_path(self):
     wcommon = WebServiceCommon(reactor=the_reactor,
                                title='',
                                ws_endpoint_string='tcp:1234',
                                ws_base_url='wss://wshost:5678/ws/')
     request = FakeRequest()
     self.assertEqual('wss://wshost:5678/ws/testpath',
                      wcommon.make_websocket_url(request, '/testpath'))