generated from coulomb/repo-seed
Harden flow advancement exit assertions
This commit is contained in:
@@ -370,3 +370,25 @@ class TestFlowEndpoints:
|
||||
|
||||
r = await client.get(f"/workstreams/{ws['id']}")
|
||||
assert r.json()["status"] == "finished"
|
||||
|
||||
async def test_advance_workstream_respects_current_exit_assertions(self, client):
|
||||
await _create_domain(client)
|
||||
topic = await _create_topic(client)
|
||||
ws = await _create_workstream(client, topic["id"], slug="exit-blocked-ws")
|
||||
dependency_ws = await _create_workstream(client, topic["id"], slug="unfinished-dep")
|
||||
task = await _create_task(client, ws["id"])
|
||||
await client.patch(f"/tasks/{task['id']}", json={"status": "done"})
|
||||
await client.post(
|
||||
f"/workstreams/{ws['id']}/dependencies/",
|
||||
json={
|
||||
"to_workstream_id": dependency_ws["id"],
|
||||
"description": "Dependency must finish first",
|
||||
},
|
||||
)
|
||||
|
||||
r = await client.post(f"/flows/workstream/{ws['id']}/advance/finished")
|
||||
assert r.status_code == 409
|
||||
assert r.json()["detail"]["blocking_assertions"][0]["id"] == "dependencies.all_complete"
|
||||
|
||||
r = await client.get(f"/workstreams/{ws['id']}")
|
||||
assert r.json()["status"] == "active"
|
||||
|
||||
Reference in New Issue
Block a user