diff --git a/tests/integration/test_classification_api.py b/tests/integration/test_classification_api.py index e2f38ad2a..9d466c423 100644 --- a/tests/integration/test_classification_api.py +++ b/tests/integration/test_classification_api.py @@ -25,15 +25,14 @@ from fastapi.testclient import TestClient sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "apps", "api")) +# mock celery_app 以避免实际发送任务 +import app.api.routes.classification_jobs as classification_routes from app.api.routes.classification_jobs import router from app.dependencies import get_classification_job_repository from packages.adapters.in_memory import InMemoryClassificationJobRepository from packages.domain import ClassificationJob, ClassificationJobStatus -# mock celery_app 以避免实际发送任务 -import app.api.routes.classification_jobs as classification_routes - classification_routes.celery_app = MagicMock() diff --git a/tests/integration/test_ingest_api.py b/tests/integration/test_ingest_api.py index 96d6087d6..2167e0b8a 100644 --- a/tests/integration/test_ingest_api.py +++ b/tests/integration/test_ingest_api.py @@ -25,15 +25,14 @@ from fastapi.testclient import TestClient sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "apps", "api")) +# mock celery_app 以避免实际发送任务 +import app.api.routes.ingest_jobs as ingest_routes from app.api.routes.ingest_jobs import router from app.dependencies import get_ingest_job_repository from packages.adapters.in_memory import InMemoryIngestJobRepository from packages.domain import IngestJob, IngestJobStatus -# mock celery_app 以避免实际发送任务 -import app.api.routes.ingest_jobs as ingest_routes - ingest_routes.celery_app = MagicMock() diff --git a/tests/unit/test_payment_callback.py b/tests/unit/test_payment_callback.py index da7711d50..4b9beec51 100644 --- a/tests/unit/test_payment_callback.py +++ b/tests/unit/test_payment_callback.py @@ -31,7 +31,7 @@ from fastapi.testclient import TestClient sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "apps" / "api")) -from app.api.routes.subscription import router, _get_plan_name, _get_plan_price +from app.api.routes.subscription import _get_plan_name, _get_plan_price, router # --------------------------------------------------------------------------- # 1. Mock Billing Repository