MCPcopy Create free account
hub / github.com/microsoft/UFO / test_protocol_send_message

Method test_protocol_send_message

tests/aip/test_protocol.py:66–80  ·  view source on GitHub ↗

Test sending a message through protocol.

(self)

Source from the content-addressed store, hash-verified

64
65 @pytest.mark.asyncio
66 async def test_protocol_send_message(self):
67 """Test sending a message through protocol."""
68 transport = MockTransport()
69 protocol = AIPProtocol(transport)
70
71 msg = ClientMessage(
72 type=ClientMessageType.HEARTBEAT,
73 client_id="test_device",
74 status=TaskStatus.OK,
75 )
76
77 await protocol.send_message(msg)
78
79 assert len(transport.sent_messages) == 1
80 assert b"heartbeat" in transport.sent_messages[0]
81
82 @pytest.mark.asyncio
83 async def test_protocol_receive_message(self):

Callers

nothing calls this directly

Calls 4

send_messageMethod · 0.95
AIPProtocolClass · 0.90
ClientMessageClass · 0.90
MockTransportClass · 0.70

Tested by

no test coverage detected