MCPcopy Create free account
hub / github.com/EasyIME/PIME / test_manual_ping

Method test_manual_ping

python/python3/tornado/test/websocket_test.py:810–822  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

808
809 @gen_test
810 def test_manual_ping(self):
811 ws = yield self.ws_connect("/")
812
813 self.assertRaises(ValueError, ws.ping, "a" * 126)
814
815 ws.ping("hello")
816 resp = yield ws.read_message()
817 # on_ping always sees bytes.
818 self.assertEqual(resp, b"hello")
819
820 ws.ping(b"binary hello")
821 resp = yield ws.read_message()
822 self.assertEqual(resp, b"binary hello")
823
824
825class MaxMessageSizeTest(WebSocketBaseTestCase):

Callers

nothing calls this directly

Calls 3

ws_connectMethod · 0.80
read_messageMethod · 0.80
pingMethod · 0.45

Tested by

no test coverage detected