test(feasibility): 修A4断言期望值——EI det=6/ftr=1低复杂度应3FP非7,非法type正确进pending(产品行为对,脚本期望值写错)

This commit is contained in:
yumoqing 2026-09-14 14:06:06 +08:00
parent 5686b255e9
commit 2304b86667

View File

@ -103,8 +103,13 @@ async def m():
bad = await call("opp_fp_estimate", {"functions_json": json.dumps(
[{"name": "x", "type": "XXX", "det": 5}, {"name": "y", "type": "EI", "det": 6, "ftr": 1}])})
db_ = json.loads(bad) if bad.startswith("{") else {}
check("A4 非法type进pending不炸", db_.get("总FP") == 7 and len(db_.get("待确认") or []) == 1,
bad[:150])
# EI det=6(档5-15) ftr=1(档0-1) → 低复杂度 → 3 FP(独立复算核对)
ref_bad = fp_ref.calc({"project": "", "functions": [
{"name": "y", "type": "EI", "det": 6, "ftr": 1}]})
check("A4 非法type进pending不炸", db_.get("总FP") == ref_bad["total_fp"] == 3
and len(db_.get("待确认") or []) == 1,
"fp=%s ref=%s pending=%d" % (db_.get("总FP"), ref_bad["total_fp"],
len(db_.get("待确认") or [])))
e1 = await call("opp_fp_estimate", {"functions_json": "[]"})
check("A5 空数组拒绝", e1.startswith("ERROR:"), e1[:80])