Skip to content

Commit 6dc1d86

Browse files
eaitbrahimclaude
andauthored
tests: read the write guards from _post, where #977 moved them (#984)
#978's prose test counted do_POST's refusing guards; #977 made do_POST a drain wrapper around _post, so the walk never reached _gated_action and main went red. The count is unchanged (four + two + the phrase = seven), so only the test moves. Mutation-checked: dropping the Sec-Fetch-Site guard from _post fails it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8189ddd commit 6dc1d86

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎tests/web/test_web_prose_stays_true.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,10 @@ def _refusing_guards(method: object, *, stop_at: str | None = None) -> list[ast.
187187
def test_the_phrase_check_names_its_place_among_every_check_before_it() -> None:
188188
"""`run_gated_action` is the LAST check a release passes. Its docstring says how many come
189189
first and which; both are read here from the two handler methods that run them, so a check
190-
added to `do_POST` (as `Sec-Fetch-Site` was) fails this until the docstring counts it."""
190+
added to `do_POST` (as `Sec-Fetch-Site` was) fails this until the docstring counts it.
191+
`do_POST` itself only wraps `_post` in the body drain (#955), so the guards are read there."""
191192
handler = server.KeelHandler
192-
before_dispatch = _refusing_guards(handler.do_POST, stop_at="_gated_action")
193+
before_dispatch = _refusing_guards(handler._post, stop_at="_gated_action")
193194
in_gated_action = _refusing_guards(handler._gated_action)
194195
checks = len(before_dispatch) + len(in_gated_action) + 1 # + the phrase itself
195196

0 commit comments

Comments
 (0)