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>
15 lines
585 B
Python
15 lines
585 B
Python
"""The trash API is routed: list, restore and purge reach handlers on the
|
|
running app. What they do is the trash service's to prove
|
|
(tests/test_services_trash.py, tests/test_mcp_tool_trash.py)."""
|
|
|
|
|
|
def test_the_trash_routes_are_on_the_app():
|
|
from grimoire.app import create_app
|
|
rules = {
|
|
(str(r.rule), m) for r in create_app().url_map.iter_rules() for m in r.methods
|
|
}
|
|
for route in (("/api/trash", "GET"),
|
|
("/api/trash/<batch_id>/restore", "POST"),
|
|
("/api/trash/<batch_id>", "DELETE")):
|
|
assert route in rules, route
|