test(review): 把 5 处既有瑕疵锁成 *_known_gap 用例
让既有瑕疵可见,而不是被当成正确行为;改 1~3(确定性检查前置/结论结构化/ 证据交叉校验)时可据此判断行为是否被改变。 - bbox_to_window 含非数值 → ValueError(上游只判长度) - summarize / extract_issues 硬下标 f['frame'] → KeyError - annotate 的 created 无去重(同 handle 产生重复批注) - extract_issues 单行 ```json[...]``` 围栏剥离失败 → [] - result_json 文本 'null' → None(与「无 text 返回 default」语义易混)
This commit is contained in:
1 parent
fa2d01aad2
commit
daccc734bf
4 files changed
+51
No files matched your search
@@ -1,5 +1,7 @@
|
||||
"""`dwg_review.phases.evidence` 单元测试。"""
|
||||
|
||||
import pytest
|
||||
|
||||
from dwg_review.phases.evidence import bbox_to_window, collect_frame
|
||||
from tests.fakes import FakeMcpClient, frame, make_ctx, ok_image, ok_text
|
||||
|
||||
@@ -13,6 +15,12 @@ def test_bbox_to_window_mapping():
|
||||
}
|
||||
|
||||
|
||||
def test_bbox_to_window_non_numeric_known_gap():
|
||||
"""已知瑕疵:4 元素但含非数值的 bbox 会抛 ValueError,上游 collect_frame 只判长度。"""
|
||||
with pytest.raises(ValueError):
|
||||
bbox_to_window([0, "a", 10, 10])
|
||||
|
||||
|
||||
def test_collect_frame_returns_none_for_missing_bbox():
|
||||
ctx = make_ctx(client=FakeMcpClient())
|
||||
assert collect_frame(ctx, 1, {}) is None
|
||||
|
||||
Reference in new issue
Block a user