Files
Akita-Meshtastic-Meshcore-B…/tests/test_config_handler_missing_default.py
sh4un 3cf9ea5d22 Refactor test and configuration files for improved readability and consistency
- Updated test_protocol.py to maintain consistent formatting and structure.
- Adjusted tmp_no_default.ini to use consistent line endings.
- Reformatted tmp_run_load.py and tmp_test_config.py for improved readability.
2026-04-17 14:36:27 -04:00

17 lines
484 B
Python

import importlib.util
def test_load_config_missing_default(tmp_path):
cfgfile = tmp_path / "no_default.ini"
cfgfile.write_text("[serial]\nSERIAL_PORT=/dev/ttyS1\n")
spec = importlib.util.spec_from_file_location(
"config_handler", "ammb/config_handler.py"
)
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
cfg = mod.load_config(str(cfgfile))
assert cfg is not None
assert cfg.log_level == "INFO"