mirror of
https://github.com/Nanaloveyuki/py-logiliteal.git
synced 2025-09-01 00:56:23 +00:00
✅ config
读取,写入,重置测试成功
This commit is contained in:
26
tests/t-configs.py
Normal file
26
tests/t-configs.py
Normal file
@ -0,0 +1,26 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
project_root = Path(__file__).parent.parent
|
||||
sys.path.append(str(project_root))
|
||||
|
||||
from src.utils.configs import get_config, set_config, reset_config
|
||||
|
||||
print(f"\n配置更换测试")
|
||||
set_config("file_level", "DEBUG")
|
||||
fl = get_config("file_level")
|
||||
print(fl)
|
||||
|
||||
set_config("file_level", "INFO")
|
||||
fl = get_config("file_level")
|
||||
print(fl)
|
||||
|
||||
print(f"\n配置重置测试")
|
||||
print(reset_config())
|
||||
|
||||
print(f"\n配置重置后测试")
|
||||
fl = get_config("file_level")
|
||||
print(fl)
|
||||
|
||||
print(f"\n未指定配置读取测试")
|
||||
print(get_config())
|
Reference in New Issue
Block a user