from __future__ import annotations from app.notify.wecom import TAG_OPEN, build_markdown, venue_label def test_build_markdown_has_tag_and_title(monkeypatch): monkeypatch.setattr("app.notify.wecom.venue_label", lambda: "模拟盘") md = build_markdown(tag=TAG_OPEN, title="开仓成功", lines=["组: G-1"]) assert "【模拟盘】开仓成功" in md assert "`OPEN`" in md assert "组: G-1" in md def test_venue_label_sim(monkeypatch): class S: is_sim = True exchange = "okx" monkeypatch.setattr("app.notify.wecom.get_settings", lambda: S()) assert venue_label() == "模拟盘"