Small improvements to the repairs testing helpers (#142511)

- Fix incorrect type on flow_id and issue_id
- Show the error when something goes wrong
This commit is contained in:
J. Nick Koston 2025-04-07 21:59:39 -10:00 committed by GitHub
parent 323c459442
commit 08304ca5f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,20 +42,20 @@ async def get_repairs(
async def start_repair_fix_flow(
client: TestClient, handler: str, issue_id: int
client: TestClient, handler: str, issue_id: str
) -> dict[str, Any]:
"""Start a flow from an issue."""
url = RepairsFlowIndexView.url
resp = await client.post(url, json={"handler": handler, "issue_id": issue_id})
assert resp.status == HTTPStatus.OK
assert resp.status == HTTPStatus.OK, f"Error: {resp.status}, {await resp.text()}"
return await resp.json()
async def process_repair_fix_flow(
client: TestClient, flow_id: int, json: dict[str, Any] | None = None
client: TestClient, flow_id: str, json: dict[str, Any] | None = None
) -> dict[str, Any]:
"""Return the repairs list of issues."""
url = RepairsFlowResourceView.url.format(flow_id=flow_id)
resp = await client.post(url, json=json)
assert resp.status == HTTPStatus.OK
assert resp.status == HTTPStatus.OK, f"Error: {resp.status}, {await resp.text()}"
return await resp.json()