From 05edf830446540f51c3f4e5b4d95c595674de188 Mon Sep 17 00:00:00 2001 From: Elmehdi Aitbrahim Date: Mon, 12 Oct 2026 16:45:26 -0400 Subject: [PATCH] tests: read the write guards from _post, where #977 moved them #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 --- tests/web/test_web_prose_stays_true.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/web/test_web_prose_stays_true.py b/tests/web/test_web_prose_stays_true.py index f5d5a8d5..2c27eb10 100644 --- a/tests/web/test_web_prose_stays_true.py +++ b/tests/web/test_web_prose_stays_true.py @@ -187,9 +187,10 @@ def _refusing_guards(method: object, *, stop_at: str | None = None) -> list[ast. def test_the_phrase_check_names_its_place_among_every_check_before_it() -> None: """`run_gated_action` is the LAST check a release passes. Its docstring says how many come first and which; both are read here from the two handler methods that run them, so a check - added to `do_POST` (as `Sec-Fetch-Site` was) fails this until the docstring counts it.""" + added to `do_POST` (as `Sec-Fetch-Site` was) fails this until the docstring counts it. + `do_POST` itself only wraps `_post` in the body drain (#955), so the guards are read there.""" handler = server.KeelHandler - before_dispatch = _refusing_guards(handler.do_POST, stop_at="_gated_action") + before_dispatch = _refusing_guards(handler._post, stop_at="_gated_action") in_gated_action = _refusing_guards(handler._gated_action) checks = len(before_dispatch) + len(in_gated_action) + 1 # + the phrase itself