diff --git a/core/routes/model_info.py b/core/routes/model_info.py deleted file mode 100644 index 808efd7..0000000 --- a/core/routes/model_info.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Compatibility exports for model information route registration.""" - -from .civitai_search import register_civitai_search_routes -from .context import RouteContext -from .custom_url import register_custom_url_routes -from .model_details import register_model_details_routes - - -def register_model_info_routes(context: RouteContext): - register_civitai_search_routes(context) - register_custom_url_routes(context) - register_model_details_routes(context) diff --git a/core/routes/search.py b/core/routes/search.py deleted file mode 100644 index 6bb1e16..0000000 --- a/core/routes/search.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Compatibility exports for search route registration.""" - -from .context import RouteContext -from .search_support import register_search_support_routes -from .source_search import register_source_search_routes - - -def register_search_routes(context: RouteContext): - register_source_search_routes(context) - register_search_support_routes(context) diff --git a/core/routes/workflow.py b/core/routes/workflow.py deleted file mode 100644 index 30d11d0..0000000 --- a/core/routes/workflow.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Compatibility exports for workflow route registration.""" - -from .context import RouteContext -from .hashes import register_hash_routes -from .loaded_models import register_loaded_model_routes -from .workflow_analysis import register_workflow_analysis_routes - -__all__ = ["register_loaded_model_routes", "register_workflow_routes"] - -def register_workflow_routes(context: RouteContext): - register_workflow_analysis_routes(context) - register_hash_routes(context) diff --git a/docs/architecture.md b/docs/architecture.md index a96b29a..a4c86ba 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -15,9 +15,9 @@ the feature logic that powers each route. 5. Services in `core/services/` contain feature behavior and receive their dependencies through `RouteContext`. -The grouping modules `core/routes/model_info.py`, `core/routes/search.py`, and -`core/routes/workflow.py` remain compatibility entry points for related route -families. The actual handlers live in focused route adapters and services. +Route registration imports the concrete route modules directly. The actual +handlers live in focused route adapters and services; no compatibility grouping +layer is kept for this application-only package. ## Adding a route diff --git a/tests/test_route_compatibility.py b/tests/test_route_compatibility.py index 57c1ab7..b3c8b67 100644 --- a/tests/test_route_compatibility.py +++ b/tests/test_route_compatibility.py @@ -7,7 +7,7 @@ from unittest.mock import AsyncMock, patch import pytest from aiohttp import web -from core.routes import base_models, model_info, search, workflow +from core.routes import base_models class _Routes: @@ -33,44 +33,6 @@ def _identity_endpoint(_name, **_kwargs): return lambda handler: handler -def test_model_info_compatibility_registers_all_model_routes(): - context = object() - with ( - patch.object(model_info, "register_civitai_search_routes") as civitai, - patch.object(model_info, "register_custom_url_routes") as custom_url, - patch.object(model_info, "register_model_details_routes") as details, - ): - model_info.register_model_info_routes(context) - - civitai.assert_called_once_with(context) - custom_url.assert_called_once_with(context) - details.assert_called_once_with(context) - - -def test_search_compatibility_registers_source_and_support_routes(): - context = object() - with ( - patch.object(search, "register_source_search_routes") as sources, - patch.object(search, "register_search_support_routes") as support, - ): - search.register_search_routes(context) - - sources.assert_called_once_with(context) - support.assert_called_once_with(context) - - -def test_workflow_compatibility_registers_analysis_and_hash_routes(): - context = object() - with ( - patch.object(workflow, "register_workflow_analysis_routes") as analysis, - patch.object(workflow, "register_hash_routes") as hashes, - ): - workflow.register_workflow_routes(context) - - analysis.assert_called_once_with(context) - hashes.assert_called_once_with(context) - - @pytest.mark.asyncio async def test_base_model_routes_return_configured_data_and_status(monkeypatch): routes = _Routes()