test: make the 429 red line actually catch its violation

Verifier mutation test: flipping _translate_429 to parse the summary
left all 824 tests green. The padding was one long string value, so the
cut landed inside it - and head-and-tail retention kept the trailing
error object, leaving the summary parseable. Many keys put the cut
between structural tokens, where the summary stops being valid JSON.
Mutation now fails as it should. Also splits OCR 429 out on its own.
This commit is contained in:
2026-08-16 06:50:50 -04:00
parent 658086e2c0
commit fa4a7e220b
2 changed files with 17 additions and 2 deletions
+6 -1
View File
@@ -312,7 +312,12 @@ class TestErrorTranslation:
@pytest.mark.parametrize(
("status", "exc_type"),
[(502, TransientError), (401, SourceDeadError), (404, RequestRejectedError)],
[
(502, TransientError),
(429, TransientError), # 与 5xx 共用分支,但仍单列: 漏分支正是 issue #10 的成因
(401, SourceDeadError),
(404, RequestRejectedError),
],
)
async def test_body_survives_every_branch(self, status, exc_type):
"""issue #10: OCR 侧 message 原本只有 HTTP 状态码,拒绝理由同样丢失。"""