test(routes): the prior-art contract guards read the handler plus its _project_scope helper (area 5 follow-up)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 6s
CI & Build / integration (push) Successful in 18s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 56s
CI & Build / Build & push image (push) Successful in 28s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-21 11:26:01 -04:00
co-authored by Claude Fable 5
parent 64c641ce80
commit 92e38ff17b
+8 -2
View File
@@ -764,7 +764,11 @@ def test_route_reads_every_arg_the_hook_sends():
import inspect
from scribe.routes import plugin as routes
src = inspect.getsource(routes.write_path_prior_art)
# The handler plus the query-scope helper it delegates repo/project_id
# to — the contract is what the ROUTE MODULE reads, wherever it reads it.
src = inspect.getsource(routes.write_path_prior_art) + inspect.getsource(
routes._project_scope
)
for arg in ("path", "code", "repo", "project_id", "exclude_ids",
"exclude_sync_ids", "shapes"):
assert f'request.args.get("{arg}"' in src, f"route ignores {arg}"
@@ -782,7 +786,9 @@ def test_route_resolves_repo_to_a_project_not_to_a_location_filter():
import inspect
from scribe.routes import plugin as routes
src = inspect.getsource(routes.write_path_prior_art)
src = inspect.getsource(routes.write_path_prior_art) + inspect.getsource(
routes._project_scope
)
assert "resolve_project" in src
assert "repo=repo" not in src