refactor(backend): 后端重构初步设想

This commit is contained in:
sophie committed 2026-06-17 11:24:54 +08:00
1 parent b69d549b2c
commit 21b8c24815
96 files changed
+1592

No files matched your search

+1
View File
@@ -0,0 +1 @@
"""tests/jobs 包:方案 D 任务层测试(Wave 2 起补充)。"""
+16
View File
@@ -0,0 +1,16 @@
"""
tests/jobs/test_registry.py
用途:验证 Job handler 注册表。
"""
from app.jobs.registry import get_handler, register_handler
from app.jobs.types import JobType
def test_register_and_get_handler():
# 断言:临时 handler 可注册并按 type 取回
@register_handler(JobType.KB_CLEAN)
def _dummy(ctx, payload):
pass
assert get_handler(JobType.KB_CLEAN) is _dummy