MCPcopy Index your code
hub / github.com/python-websockets/websockets / test_client_sends_text

Method test_client_sends_text

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

Source from the content-addressed store, hash-verified

234 """
235
236 def test_client_sends_text(self):
237 client = Protocol(CLIENT)
238 with patch("secrets.token_bytes", return_value=b"\x00\x00\x00\x00"):
239 client.send_text("😀".encode())
240 self.assertEqual(
241 client.data_to_send(), [b"\x81\x84\x00\x00\x00\x00\xf0\x9f\x98\x80"]
242 )
243
244 def test_server_sends_text(self):
245 server = Protocol(SERVER)

Callers

nothing calls this directly

Calls 4

send_textMethod · 0.95
data_to_sendMethod · 0.95
ProtocolClass · 0.50
encodeMethod · 0.45

Tested by

no test coverage detected