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

Method test_client_sends_close

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

Source from the content-addressed store, hash-verified

824 self.assertIsNone(client.close_reason)
825
826 def test_client_sends_close(self):
827 client = Protocol(CLIENT)
828 with patch("secrets.token_bytes", return_value=b"\x3c\x3c\x3c\x3c"):
829 client.send_close()
830 self.assertEqual(client.data_to_send(), [b"\x88\x80\x3c\x3c\x3c\x3c"])
831 self.assertIs(client.state, CLOSING)
832
833 def test_server_sends_close(self):
834 server = Protocol(SERVER)

Callers

nothing calls this directly

Calls 3

send_closeMethod · 0.95
data_to_sendMethod · 0.95
ProtocolClass · 0.50

Tested by

no test coverage detected