meshcore_py/tests
Matthew Wolter 7293933582 G2: add verification tests for F22, F21/M01, M02, M04, N06, F14
12 new tests in tests/unit/test_g2_error_handling.py covering all
G2 findings:

- test_g2_event_is_error_true/false (F22): is_error() helper works.
- test_g2_send_msg_with_retry_error_no_keyerror (F21/M01): retry
  loop continues on ERROR instead of KeyError on missing expected_ack.
- test_g2_send_appstart_returns_error (M02): ERROR event returned
  immediately instead of hanging until timeout.
- test_g2_set_telemetry_mode_base/loc/env_error (M04): setters
  return ERROR instead of KeyError on appstart failure.
- test_g2_set_manual_add_contacts/advert_loc_policy/multi_acks_error
  (M04): remaining three setters return ERROR cleanly.
- test_g2_send_anon_req_contact_not_found (N06): returns ERROR
  instead of TypeError on NoneType subscript.
- test_g2_send_trace_unknown_path_hash_len (F14): returns ERROR
  instead of NameError on undefined 'e'.

Refs: Forensics report findings F22, F21, M01, M02, M04, N06, F14
2026-04-11 20:05:07 -07:00
..
unit G2: add verification tests for F22, F21/M01, M02, M04, N06, F14 2026-04-11 20:05:07 -07:00
README.md Added in some unit tests 2025-04-13 22:55:39 -07:00
test_ble_connection.py Implement BLE PIN pairing support for enhanced security 2025-09-24 00:21:30 +02:00
test_ble_pin_pairing.py Implement BLE PIN pairing support for enhanced security 2025-09-24 00:21:30 +02:00
test_meshcore_ble_pin.py Implement BLE PIN pairing support for enhanced security 2025-09-24 00:21:30 +02: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