Test sending a message through protocol.
(self)
| 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): |
nothing calls this directly
no test coverage detected