Implement credit parse result polling and sentinel handling

This commit is contained in:
wkc
2026-05-18 10:56:25 +08:00
parent 9917d10e59
commit 1fadb38d99
25 changed files with 918 additions and 81 deletions

View File

@@ -26,12 +26,16 @@ class FakeStaffIdentityRepository:
@pytest.fixture(autouse=True)
def reset_file_service_state():
"""避免 file_service 单例状态影响测试顺序。"""
from routers import credit_api
file_service.file_records.clear()
file_service.log_counter = settings.INITIAL_LOG_ID
file_service.staff_identity_repository = FakeStaffIdentityRepository()
credit_api.result_cache.clear()
yield
file_service.file_records.clear()
file_service.log_counter = settings.INITIAL_LOG_ID
credit_api.result_cache.clear()
@pytest.fixture
@@ -41,7 +45,7 @@ def client():
try:
from routers import credit_api
if not any(route.path == "/xfeature-mngs/conversation/htmlEval" for route in app.routes):
if not any(route.path == "/api/service/interface/invokeService/xfeature" for route in app.routes):
app.include_router(credit_api.router, tags=["征信解析接口"])
app.openapi_schema = None
except ModuleNotFoundError: