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

Method test_client_receives_close

tests/test_protocol.py:839–845  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

837 self.assertIs(server.state, CLOSING)
838
839 def test_client_receives_close(self):
840 client = Protocol(CLIENT)
841 with patch("secrets.token_bytes", return_value=b"\x3c\x3c\x3c\x3c"):
842 client.receive_data(b"\x88\x00")
843 self.assertEqual(client.events_received(), [Frame(OP_CLOSE, b"")])
844 self.assertEqual(client.data_to_send(), [b"\x88\x80\x3c\x3c\x3c\x3c"])
845 self.assertIs(client.state, CLOSING)
846
847 def test_server_receives_close(self):
848 server = Protocol(SERVER)

Callers

nothing calls this directly

Calls 5

receive_dataMethod · 0.95
events_receivedMethod · 0.95
data_to_sendMethod · 0.95
FrameClass · 0.90
ProtocolClass · 0.50

Tested by

no test coverage detected