mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
100% Coverage
This commit is contained in:
@@ -300,3 +300,35 @@ def test_submit_up_rejects_empty_notes() -> None:
|
||||
)
|
||||
|
||||
assert resp.status_code == _HTTP_422
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_unclaim_dispatches() -> None:
|
||||
mock_chore = MagicMock()
|
||||
mock_chore.unclaim = AsyncMock(
|
||||
return_value=_make_envelope(status="awaiting_pm_review", task_id=_TASK_ID)
|
||||
)
|
||||
client = TestClient(_build_app(mock_chore))
|
||||
resp = client.post(
|
||||
"/api/v2/flow/cell_pm/unclaim",
|
||||
json={"task_id": _TASK_ID},
|
||||
headers=_HEADERS,
|
||||
)
|
||||
assert resp.status_code == _HTTP_200
|
||||
mock_chore.unclaim.assert_awaited_once()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_resume_dispatches() -> None:
|
||||
mock_chore = MagicMock()
|
||||
mock_chore.resume = AsyncMock(
|
||||
return_value=_make_envelope(status="in_progress", task_id=_TASK_ID)
|
||||
)
|
||||
client = TestClient(_build_app(mock_chore))
|
||||
resp = client.post(
|
||||
"/api/v2/flow/cell_pm/resume",
|
||||
json={"task_id": _TASK_ID},
|
||||
headers=_HEADERS,
|
||||
)
|
||||
assert resp.status_code == _HTTP_200
|
||||
mock_chore.resume.assert_awaited_once()
|
||||
|
||||
Reference in New Issue
Block a user