From c5a95c9198668ce594307b3fbd698cb299520803 Mon Sep 17 00:00:00 2001 From: ThearchyHelios Date: Tue, 13 Oct 2026 16:59:58 +0800 Subject: [PATCH] =?UTF-8?q?test=5Fmasking=5Ftool=5Fboundary=EF=BC=9A?= =?UTF-8?q?=E6=9F=A5=E9=87=91=E9=A2=9D=E5=8E=9F=E5=80=BC=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E5=85=88=E5=8E=BB=E6=8E=89=E5=93=88=E5=B8=8C=E2=80=94=E2=80=94?= =?UTF-8?q?=E5=B7=A5=E4=BB=B6=20id=E3=80=81=E5=BF=AB=E7=85=A7=E9=87=8C?= =?UTF-8?q?=E8=AE=B0=E7=9A=84=E5=93=88=E5=B8=8C=E6=98=AF=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E7=9A=84=E5=8D=81=E5=85=AD=E8=BF=9B=E5=88=B6=EF=BC=8C=E5=81=B6?= =?UTF-8?q?=E5=B0=94=E7=A2=B0=E5=B7=A7=E5=90=AB=E3=80=8C1200=E3=80=8D?= =?UTF-8?q?=EF=BC=8C=E5=85=A8=E9=87=8F=E5=B9=B6=E8=A1=8C=E6=97=B6=E5=81=B6?= =?UTF-8?q?=E5=8F=91=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/tests/test_masking_tool_boundary.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/tests/test_masking_tool_boundary.py b/backend/tests/test_masking_tool_boundary.py index 9f2797ad..2323c2af 100644 --- a/backend/tests/test_masking_tool_boundary.py +++ b/backend/tests/test_masking_tool_boundary.py @@ -12,6 +12,7 @@ from __future__ import annotations import json +import re import pytest from httpx import ASGITransport, AsyncClient @@ -86,7 +87,8 @@ async def test_the_model_and_the_snapshot_see_only_masks_when_the_analysis_fails assert _clean(json.dumps(snapshot, ensure_ascii=False)) async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client: got = await client.get(f"/api/artifacts/{out.queries[0]['artifact']}") - assert got.status_code == 200 and _clean(got.text) and "1200" not in got.text + # 金额原值不出现。先去掉哈希再查:工件 id、快照里记的哈希是随机的十六进制,偶尔碰巧含「1200」 + assert got.status_code == 200 and _clean(got.text) and "1200" not in re.sub(r"[0-9a-f]{32,}", "", got.text) assert out.result["value"] is None assert out.cells[0]["reason"] == "Q1 的写法认不全,整份结果查询时已遮罩,不采信"