修改问题

This commit is contained in:
strepsiades
2026-04-01 17:04:26 +08:00
parent 7c49df94fc
commit 9a3a34c58b
10 changed files with 119 additions and 29 deletions
@@ -263,7 +263,7 @@ async def test_create_all_marks_duplicate_project_key_in_same_batch_as_error() -
@pytest.mark.asyncio
async def test_create_node_reuses_existing_node_by_project_key_and_rebinds_data_id() -> None:
async def test_create_node_raises_on_existing_project_key_with_different_data_id() -> None:
collection = DataCollection("remote")
handler = ProjectDetailApiHandler()
@@ -278,17 +278,15 @@ async def test_create_node_reuses_existing_node_by_project_key_and_rebinds_data_
)
await collection.add(existing)
created = handler._create_node(
{
"id": "remote-detail-99",
"project_id": "project-1",
"key": "plan_construction",
"value": [{"date": "2026-01-01", "capacity": 21.0}],
}
)
assert created.node_id == "detail-node-old"
assert created.data_id == "remote-detail-99"
with pytest.raises(RuntimeError, match="project_detail_data load conflict"):
handler._create_node(
{
"id": "remote-detail-99",
"project_id": "project-1",
"key": "plan_construction",
"value": [{"date": "2026-01-01", "capacity": 21.0}],
}
)
@pytest.mark.asyncio