test(8249): the caller-scoping contract is a property of the services, not four lists of names
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>
This commit is contained in:
@@ -60,21 +60,6 @@ def test_every_endpoint_is_reachable_on_the_app():
|
||||
}
|
||||
|
||||
|
||||
def test_service_functions_take_user_id():
|
||||
"""Routes must call the services with user_id — verify the contract (#33)."""
|
||||
from grimoire.services import design_systems as svc
|
||||
for fn_name in (
|
||||
"create_design_system", "list_design_systems", "get_design_system",
|
||||
"update_design_system", "delete_design_system", "resolve_design_system",
|
||||
"create_token", "list_tokens", "update_token", "delete_token",
|
||||
"set_project_design_system",
|
||||
"stylesheet_for_system", "check_snippets_against_system",
|
||||
):
|
||||
fn = getattr(svc, fn_name)
|
||||
assert callable(fn)
|
||||
assert "user_id" in inspect.signature(fn).parameters
|
||||
|
||||
|
||||
def test_agent_and_web_surfaces_stay_at_parity():
|
||||
"""The MCP tools and the REST routes are two callers of one service; a
|
||||
capability on one has to exist on the other.
|
||||
|
||||
Reference in New Issue
Block a user