plan(SP22): Task 5 — add test_parse_837_does_not_retry_on_5xx to spec (locks in dedup-safety contract)

This commit is contained in:
Tyler
2026-06-21 13:50:51 -06:00
parent 3e00fb3f63
commit f6f821e082
@@ -943,6 +943,19 @@ async def test_parse_837_posts_file_and_returns_summary(client, sample_837p_path
# Confirm multipart upload # Confirm multipart upload
content_type = route.calls.last.request.headers["content-type"] content_type = route.calls.last.request.headers["content-type"]
assert "multipart/form-data" in content_type assert "multipart/form-data" in content_type
@pytest.mark.asyncio
@respx.mock
async def test_parse_837_does_not_retry_on_5xx(client, sample_837p_path):
"""parse_837 is a POST — retries would double-submit, so the
dedup-safety contract is that 5xx propagates without retry."""
route = respx.post("http://test:8000/api/parse-837").mock(
return_value=Response(503, json={"error": "transient"})
)
with pytest.raises(httpx.HTTPStatusError):
await client.parse_837(sample_837p_path, payer="co_medicaid")
assert route.call_count == 1
``` ```
- [ ] **Step 2: Run test to verify it fails** - [ ] **Step 2: Run test to verify it fails**