mirror of
https://github.com/AkitaEngineering/Akita-Meshtastic-Meshcore-Bridge.git
synced 2026-03-28 17:42:42 +01:00
15 lines
454 B
Python
15 lines
454 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'
|