Files
meshcore_py/tests
Matthew Wolter 1b1d66053c test: fix send_raw_data wrapper for 4-byte guard and path_len framing
Why: PR #86 (44b21be) reworked send_raw_data to frame as
0x19 | path_len(1) | path | payload and to reject payloads under 4
bytes, but left test_send_raw_data_wrapper unchanged. The test sent a
2-byte payload (now raising ValueError before any assertion) and
asserted captured_data[1:] == payload, which no longer holds because of
the inserted path_len byte. The firmware drops payloads under 4 bytes,
so the guard is correct; this fixes the test, not the guard.

Bumps the payload to 4 bytes and asserts the zero path_len byte plus the
payload at offset 2, validating the wire format #86 introduced.

Tests: tests/unit/test_protocol_surface_gaps.py -- full suite 156 passed
(test_send_raw_data_wrapper was the lone failure on current main).
2026-06-15 16:55:41 -07:00
..
2025-04-13 22:55:39 -07:00

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