This commit is contained in:
2026-02-27 16:03:04 +08:00
commit 5aedf1665d
137 changed files with 17604 additions and 0 deletions

33
tests/test_config.py Normal file
View File

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
"""配置中心测试"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
def test_config_paths():
from config.config import ROOT, LOG_DIR, RESULTS_DIR, CONFIG_DIR
assert ROOT.exists()
assert ROOT.is_dir()
assert (ROOT / "config").samefile(CONFIG_DIR)
assert LOG_DIR == ROOT / "logs"
print("config paths OK")
def test_config_values():
from config.config import (
IMAGE_QUEUE_MAX_CONCURRENT,
IMAGE_QUEUE_MAX_SIZE,
LOG_MAX_BYTES,
LOG_BACKUP_COUNT,
)
assert IMAGE_QUEUE_MAX_CONCURRENT >= 1
assert IMAGE_QUEUE_MAX_SIZE >= 1
assert LOG_MAX_BYTES > 0
assert LOG_BACKUP_COUNT >= 1
print("config values OK")
if __name__ == "__main__":
test_config_paths()
test_config_values()
print("All config tests passed")