Files
Akita-Meshtastic-Meshcore-B…/tests/conftest.py
sh4un f64b3ae9ec Add comprehensive tests for meshcore-related functionality
- Introduced `test_meshcore.py` with extensive unit tests for:
  - RawSerialProtocol and MeshcoreCompanionProtocol
  - MessageValidator
  - MeshcoreHandler and MeshcoreAsyncHandler
- Enhanced `conftest.py` to include new configuration option `SERIAL_AUTO_SWITCH`.
- Verified encoding and decoding processes for various message types.
- Ensured proper handling of edge cases and error conditions.
2026-02-07 14:24:45 -05:00

23 lines
634 B
Python

import configparser
import pytest
@pytest.fixture(scope="function")
def temp_config_file(tmp_path):
config_path = tmp_path / "config.ini"
parser = configparser.ConfigParser()
parser["DEFAULT"] = {
"MESHTASTIC_SERIAL_PORT": "/dev/test_meshtastic",
"EXTERNAL_TRANSPORT": "serial",
"SERIAL_PORT": "/dev/test_meshcore",
"SERIAL_BAUD_RATE": "19200",
"SERIAL_PROTOCOL": "json_newline",
"MESSAGE_QUEUE_SIZE": "50",
"LOG_LEVEL": "DEBUG",
"SERIAL_AUTO_SWITCH": "True",
}
with open(config_path, "w") as f:
parser.write(f)
yield str(config_path)