mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-11-01 10:12:03 +00:00
The companion protocol lists PACKET_CHANNEL_DATA_RECV (0x1B) as an answer to GET_MESSAGE (0x0A). PR #88 added the CHANNEL_DATA_RECV event and parser, but get_msg() still waited only for CONTACT_MSG_RECV, CHANNEL_MSG_RECV, ERROR and NO_MORE_MSGS. When the next queued message is a channel datagram, get_msg() therefore ignored the device's answer and returned ERROR (reason "timeout") after default_timeout, which also stops the auto-fetch loop. Add CHANNEL_DATA_RECV to the expected events and cover it with a test that runs a real CHANNEL_DATA_RECV frame through MessageReader and EventDispatcher. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MeshCore Tests
Running Tests
To run the tests, first install the development dependencies:
pip install -e ".[dev]"
Then run the tests using pytest:
# Run all tests
pytest
# Run tests with verbose output
pytest -v
# Run a specific test file
pytest tests/unit/test_commands.py
# Run a specific test
pytest tests/unit/test_commands.py::test_send_msg