Review of the signature-flagged tests:
- Four route files each listed service names by hand and checked each takes
user_id. A new service without the caller passed them, and a renamed one
failed them. They become one test over services/{design_systems,systems,
rulebooks,snippets}.py: every public coroutine takes user_id, except eight
named with the reason each needs none, and an exception for a function that
is gone or now takes the caller fails too.
- test_routes_trash was four existence checks: blueprint name, registered,
handlers callable, the service surface, delete's parameter names. It
becomes one check that the three trash routes are on the app; what they do
is proven by test_services_trash and test_mcp_tool_trash.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
859 B
Python
28 lines
859 B
Python
"""Structural tests for the systems blueprint — registration + handler/service
|
|
contracts. Full HTTP integration needs a live DB + auth the unit env lacks."""
|
|
import inspect
|
|
|
|
|
|
def test_systems_blueprint_registered():
|
|
from grimoire.routes.systems import systems_bp
|
|
assert systems_bp.name == "systems"
|
|
assert systems_bp.url_prefix == "/api/projects"
|
|
|
|
|
|
def test_systems_blueprint_registered_in_app():
|
|
from grimoire.app import create_app
|
|
app = create_app()
|
|
assert "systems" in app.blueprints
|
|
|
|
|
|
def test_system_handlers_callable():
|
|
from grimoire.routes import systems as routes
|
|
for name in (
|
|
"list_systems_route", "create_system_route", "get_system_route",
|
|
"update_system_route", "delete_system_route", "system_records_route",
|
|
"project_issues_route",
|
|
):
|
|
assert callable(getattr(routes, name))
|
|
|
|
|