fix(data-process): 修正详情统计字段契约

This commit is contained in:
caoxiaozhu
2026-07-24 16:28:47 +08:00
parent d6d3d27b2d
commit 994ec6644a
2 changed files with 47 additions and 10 deletions

View File

@@ -1,13 +1,27 @@
from __future__ import annotations
from decimal import Decimal
import pytest
from app.modules.data_process.store import (
DataProcessStoreError,
_decode_row,
_source_storage_descriptor,
)
def test_decode_row_serializes_postgres_numeric_values_as_json_numbers() -> None:
decoded = _decode_row(
{
"progress": Decimal("100.00"),
"duration_seconds": Decimal("389.000000"),
}
)
assert decoded == {"progress": 100.0, "duration_seconds": 389.0}
def test_source_storage_descriptor_accepts_owned_local_and_legacy_db_references() -> None:
task_id = "dpt_task"
source_file_id = "dpsf_source"