self.write_message(message)
+class PathArgsHandler(TestWebSocketHandler):
+ def open(self, arg):
+ self.write_message(arg)
+
+
class WebSocketBaseTestCase(AsyncHTTPTestCase):
@gen.coroutine
def ws_connect(self, path, compression_options=None):
dict(close_future=self.close_future)),
('/async_prepare', AsyncPrepareHandler,
dict(close_future=self.close_future)),
+ ('/path_args/(.*)', PathArgsHandler,
+ dict(close_future=self.close_future)),
])
def test_http_request(self):
res = yield ws.read_message()
self.assertEqual(res, 'hello')
+ @gen_test
+ def test_path_args(self):
+ ws = yield self.ws_connect('/path_args/hello')
+ res = yield ws.read_message()
+ self.assertEqual(res, 'hello')
+
@gen_test
def test_check_origin_valid_no_path(self):
port = self.get_http_port()