"""Structural tests for the platforms blueprint (milestone 463 step 2) — registration and the route-to-service contract. What the writes do is in tests/test_integration_platforms.py.""" import inspect def test_platforms_blueprint_registered_in_app(): from scribe.app import create_app app = create_app() assert "platforms" in app.blueprints rules = {(r.rule, m) for r in app.url_map.iter_rules() for m in r.methods} for rule, method in ( ("/api/platforms", "GET"), ("/api/platforms", "POST"), ("/api/platforms/", "PATCH"), ("/api/projects//platforms", "GET"), ("/api/projects//platforms", "PUT"), ): assert (rule, method) in rules, f"{method} {rule} is not routed" def test_writes_to_the_catalog_and_to_a_project_take_the_caller(): """The catalog's admin gate and the project's write gate both live in the service, so every write must be handed the caller to check.""" from scribe.services import platforms as svc for name in ("create_platform", "update_platform", "set_project_platforms", "project_platforms"): assert "user_id" in inspect.signature(getattr(svc, name)).parameters