From 3c186ac217e6ec08e9a46d0f2d8099fa9cb90eee Mon Sep 17 00:00:00 2001 From: zlt Date: Wed, 9 Sep 2026 12:17:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8C=89=20PMS=20=E8=87=AA?= =?UTF-8?q?=E5=B7=B1=E7=9A=84=E4=BB=A3=E7=A0=81=E5=BD=A2=E6=80=81=E5=8F=96?= =?UTF-8?q?=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 --- scripts/test_batch23_units.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/test_batch23_units.py b/scripts/test_batch23_units.py index 2bac6e3..b250309 100644 --- a/scripts/test_batch23_units.py +++ b/scripts/test_batch23_units.py @@ -87,14 +87,15 @@ def test_judge_whitelist(): def test_positions_view(): payload = {"date": "2026-09-09", "states": [{"code": "SH601126", "state": "逻辑成立", "why": None, "as_of": "2026-09-08", "reasons": ["a"], "company_review": _cr(), "company_review_text": "公司深度:质地好…"}]} - st = pf.parse_logic_states(payload)["SH601126"] + parsed = pf.parse_logic_states(payload) + key, st = next(iter(parsed.items())) # 键是 PMS 自己的代码形态 (normalize_code), 不猜 assert st["company_review"]["overall"] == "好" and st["company_review_text"].startswith("公司深度") v = lss.company_view(st) assert v["overall"] == "好" and "质地好" in v["line"] and v["invalidation"] == "下一期看现金流" and v["report_url"] assert lss.company_view({"state": "逻辑成立"}) is None - rows = [{"ts_code": "SH601126", "total_qty": 0}] + rows = [{"ts_code": key, "total_qty": 0}] with _Patch() as p: - p(lss, "state_map", lambda: {"SH601126": st}) + p(lss, "state_map", lambda: {key: st}) lss.decorate_positions(rows) assert rows[0]["company"]["overall"] == "好"