MCPcopy Create free account
hub / github.com/python-websockets/websockets / test_ping_default

Method test_ping_default

tests/legacy/test_protocol.py:819–826  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

817 # Test the ping coroutine.
818
819 def test_ping_default(self):
820 self.loop.run_until_complete(self.protocol.ping())
821 # With our testing tools, it's more convenient to extract the expected
822 # ping data from the library's internals than from the frame sent.
823 ping_data = next(iter(self.protocol.pings))
824 self.assertIsInstance(ping_data, bytes)
825 self.assertEqual(len(ping_data), 4)
826 self.assertOneFrameSent(True, OP_PING, ping_data)
827
828 def test_ping_text(self):
829 self.loop.run_until_complete(self.protocol.ping("café"))

Callers

nothing calls this directly

Calls 2

assertOneFrameSentMethod · 0.95
pingMethod · 0.45

Tested by

no test coverage detected