diff --git a/projects/policyengine-api-simulation/src/modal/gateway/responses.py b/projects/policyengine-api-simulation/src/modal/gateway/responses.py index 04e7682ef..6645379e8 100644 --- a/projects/policyengine-api-simulation/src/modal/gateway/responses.py +++ b/projects/policyengine-api-simulation/src/modal/gateway/responses.py @@ -37,6 +37,8 @@ def batch_status_response(response: BudgetWindowBatchStatusResponse): return AcceptedResponse(payload) if response.status == "failed": return ServerErrorResponse(payload) + if response.status == "complete": + return JSONResponse(status_code=200, content=payload) return response diff --git a/projects/policyengine-api-simulation/tests/gateway/test_endpoints.py b/projects/policyengine-api-simulation/tests/gateway/test_endpoints.py index 9ce685470..3214c73df 100644 --- a/projects/policyengine-api-simulation/tests/gateway/test_endpoints.py +++ b/projects/policyengine-api-simulation/tests/gateway/test_endpoints.py @@ -733,6 +733,13 @@ def test__given_batch_state__then_poll_returns_completed_response( assert response.json()["status"] == "complete" assert response.json()["result"]["years"] == ["2026", "2027"] assert "annualImpacts" not in response.json()["result"] + output = response.json()["result"]["outputsByYear"]["2026"] + assert output["poverty_by_race"] is None + assert output["wealth_decile"] is None + assert output["intra_wealth_decile"] is None + assert output["constituency_impact"] is None + assert output["local_authority_impact"] is None + assert output["cliff_impact"] is None assert response.json()["result"]["totals"]["budgetaryImpact"] == 32 assert response.json()["run_id"] == "batch-run-123"