MCPcopy Index your code
hub / github.com/miguelgrinberg/python-socketio / test_emit_binary

Method test_emit_binary

tests/async/test_client.py:425–440  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

423 c._generate_ack_id.assert_called_once_with('/foo', 'cb')
424
425 async def test_emit_binary(self):
426 c = async_client.AsyncClient()
427 c.namespaces = {'/': '1'}
428 c._send_packet = mock.AsyncMock()
429 await c.emit('foo', b'bar')
430 expected_packet = packet.Packet(
431 packet.EVENT,
432 namespace='/',
433 data=['foo', b'bar'],
434 id=None,
435 )
436 assert c._send_packet.await_count == 1
437 assert (
438 c._send_packet.await_args_list[0][0][0].encode()
439 == expected_packet.encode()
440 )
441
442 async def test_emit_not_binary(self):
443 c = async_client.AsyncClient()

Callers

nothing calls this directly

Calls 2

emitMethod · 0.95
encodeMethod · 0.95

Tested by

no test coverage detected