|
|
|
@ -136,5 +136,23 @@ class TestApp(AsyncHTTPTestCase):
|
|
|
|
|
ws = yield tornado.websocket.websocket_connect(ws_url)
|
|
|
|
|
msg = yield ws.read_message()
|
|
|
|
|
self.assertIn(b'Welcome!', msg)
|
|
|
|
|
|
|
|
|
|
# message will be ignored silently
|
|
|
|
|
yield ws.write_message('hello')
|
|
|
|
|
yield ws.write_message('"hello"')
|
|
|
|
|
yield ws.write_message('[hello]')
|
|
|
|
|
yield ws.write_message(json.dumps({'resize': []}))
|
|
|
|
|
yield ws.write_message(json.dumps({'resize': {}}))
|
|
|
|
|
yield ws.write_message(json.dumps({'resize': [100]}))
|
|
|
|
|
yield ws.write_message(json.dumps({'resize': [100]*10}))
|
|
|
|
|
yield ws.write_message(json.dumps({'resize': [-1, -1]}))
|
|
|
|
|
yield ws.write_message(json.dumps({'data': [1]}))
|
|
|
|
|
yield ws.write_message(json.dumps({'data': (1,)}))
|
|
|
|
|
yield ws.write_message(json.dumps({'data': {'a': 2}}))
|
|
|
|
|
yield ws.write_message(json.dumps({'data': 1}))
|
|
|
|
|
yield ws.write_message(json.dumps({'data': 2.1}))
|
|
|
|
|
yield ws.write_message(json.dumps({'key-non-existed': 'hello'}))
|
|
|
|
|
yield ws.write_message(json.dumps({'resize': [79, 23], 'data': 'bye'}))
|
|
|
|
|
msg = yield ws.read_message()
|
|
|
|
|
self.assertEqual(b'bye', msg)
|
|
|
|
|
ws.close()
|
|
|
|
|