feat: extend operational investigation workflows
This commit is contained in:
@@ -48,12 +48,13 @@ async def test_create_work_order_confirms_creation_not_field_completion():
|
||||
calls.append(request)
|
||||
return httpx.Response(201, json={"work_order_id": str(uuid4()),
|
||||
"project_id": str(data["context"].project_id), "created_at": "2026-09-23T08:00:00Z",
|
||||
"origin": "synthetic", "status": "open"})
|
||||
"origin": "system_data", "status": "open"})
|
||||
adapter = HttpOperationalActionDispatcher(settings(), transport=httpx.MockTransport(handler))
|
||||
result = await adapter.dispatch(**data)
|
||||
assert result.status == "succeeded"
|
||||
assert result.receipt.external_status == "open"
|
||||
assert "现场工作进度" in result.detail
|
||||
assert result.detail == "外围工单已创建,现场工作进度由外围系统继续同步"
|
||||
assert calls[0].url.path == "/api/sample/v1/work-orders"
|
||||
assert calls[0].headers["X-Project-Id"] == str(data["context"].project_id)
|
||||
|
||||
@@ -66,7 +67,7 @@ async def test_work_order_receipt_accepts_awaiting_reply_status():
|
||||
"work_order_id": str(uuid4()),
|
||||
"project_id": str(data["context"].project_id),
|
||||
"created_at": "2026-09-23T08:00:00Z",
|
||||
"origin": "synthetic",
|
||||
"origin": "system_data",
|
||||
"status": "awaiting_reply",
|
||||
})
|
||||
adapter = HttpOperationalActionDispatcher(
|
||||
@@ -90,7 +91,7 @@ async def test_action_work_order_is_not_reclassified_as_a_new_inbound_event():
|
||||
"work_order_id": str(uuid4()),
|
||||
"project_id": str(data["context"].project_id),
|
||||
"created_at": "2026-09-23T08:00:00Z",
|
||||
"origin": "synthetic",
|
||||
"origin": "system_data",
|
||||
"status": "open",
|
||||
})
|
||||
|
||||
@@ -111,7 +112,7 @@ async def test_lost_create_response_recovers_same_request_without_second_write()
|
||||
raise httpx.ReadTimeout("lost", request=request)
|
||||
return httpx.Response(200, json={"request_id": request.url.path.split("/")[-1],
|
||||
"result": {"work_order_id": str(uuid4()), "project_id": str(data["context"].project_id),
|
||||
"created_at": "2026-09-23T08:00:00Z", "origin": "synthetic", "status": "open"}})
|
||||
"created_at": "2026-09-23T08:00:00Z", "origin": "system_data", "status": "open"}})
|
||||
result = await HttpOperationalActionDispatcher(settings(), transport=httpx.MockTransport(handler)).dispatch(**data)
|
||||
assert result.status == "succeeded"
|
||||
assert methods == ["POST", "GET"]
|
||||
@@ -122,7 +123,7 @@ async def test_unconfirmed_receipt_remains_unknown_not_failed_or_succeeded():
|
||||
data = inputs()
|
||||
def handler(request):
|
||||
return httpx.Response(200, json={"work_order_id": str(uuid4()), "project_id": str(uuid4()),
|
||||
"created_at": "2026-09-23T08:00:00Z", "origin": "synthetic", "status": "open"})
|
||||
"created_at": "2026-09-23T08:00:00Z", "origin": "system_data", "status": "open"})
|
||||
result = await HttpOperationalActionDispatcher(settings(), transport=httpx.MockTransport(handler)).dispatch(**data)
|
||||
assert result.status == "unknown"
|
||||
assert result.receipt is None
|
||||
|
||||
Reference in New Issue
Block a user