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

Method test_abort_ping

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

Source from the content-addressed store, hash-verified

970 self.assertTrue(pong_waiter.done())
971
972 def test_abort_ping(self):
973 pong_waiter = self.loop.run_until_complete(self.protocol.ping())
974 # Remove the frame from the buffer, else close_connection() complains.
975 self.last_sent_frame()
976 self.assertFalse(pong_waiter.done())
977 self.close_connection()
978 self.assertTrue(pong_waiter.done())
979 self.assertIsInstance(pong_waiter.exception(), ConnectionClosed)
980
981 def test_abort_ping_does_not_log_exception_if_not_retreived(self):
982 self.loop.run_until_complete(self.protocol.ping())

Callers

nothing calls this directly

Calls 4

last_sent_frameMethod · 0.95
close_connectionMethod · 0.95
pingMethod · 0.45
exceptionMethod · 0.45

Tested by

no test coverage detected