Files
eth_hedge_sim/backend/tests/test_wecom_notify.py
T
dekun 56a4007130 Add WeCom markdown alerts and keep target exits while strategy is paused.
Notify open/close/start/pause/fault with SIM vs LIVE venue labels; configure webhook in Settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 23:19:39 +08:00

21 lines
631 B
Python

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() == "模拟盘"