mirror of
https://github.com/AkitaEngineering/Akita-Meshtastic-Meshcore-Bridge.git
synced 2026-07-05 17:31:25 +02:00
3cf9ea5d22
- 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.
17 lines
484 B
Python
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"
|