Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions notifications/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@
"order_id_suffix": "(订单号: {order_id})",
"small_account_warning_note": "小账户提示:净值 {portfolio_equity} 低于建议 {min_recommended_equity};{reason}",
"small_account_warning_reason_integer_shares_min_position_value_may_prevent_backtest_replication": "整数股和最小仓位限制可能导致实盘无法完全复现回测",
"strategy_plugin_line": "🧩 插件:{plugin} | 模式:{mode} | 路由:{route} | 建议:{action}",
"strategy_plugin_name_crisis_response_shadow": "危机响应观察",
"strategy_plugin_line": "🧩 插件:{plugin} | 状态:{route} | 提醒:{action}",
"strategy_plugin_name_crisis_response_shadow": "危机观察通知",
"strategy_plugin_mode_shadow": "影子观察",
"strategy_plugin_route_no_action": "不操作",
"strategy_plugin_route_no_action": "未触发危机",
"strategy_plugin_route_true_crisis": "真危机",
"strategy_plugin_route_taco_fake_crisis": "TACO 假危机",
"strategy_plugin_route_unknown_route": "未知路由",
"strategy_plugin_route_unknown_route": "未知状态",
"strategy_plugin_action_no_action": "不操作",
"strategy_plugin_action_watch_only": "仅观察",
"strategy_plugin_action_watch_only": "仅通知",
"strategy_plugin_action_small_taco": "小仓 TACO",
"strategy_plugin_action_defend": "防守",
"strategy_plugin_action_blocked": "已阻断",
"strategy_plugin_action_monitor": "监控",
"strategy_plugin_action_unknown_action": "未知建议",
"strategy_plugin_action_monitor": "持续观察",
"strategy_plugin_action_unknown_action": "未知提醒",
"strategy_name_tqqq_growth_income": "TQQQ 增长收益",
"strategy_name_soxl_soxx_trend_income": "SOXL/SOXX 半导体趋势收益",
"strategy_name_global_etf_rotation": "全球 ETF 轮动",
Expand Down Expand Up @@ -155,20 +155,20 @@
"order_id_suffix": "(ID: {order_id})",
"small_account_warning_note": "small account warning: portfolio equity {portfolio_equity} is below recommended {min_recommended_equity}; {reason}",
"small_account_warning_reason_integer_shares_min_position_value_may_prevent_backtest_replication": "integer-share minimum position sizing may prevent backtest replication",
"strategy_plugin_line": "🧩 Plugin: {plugin} | mode: {mode} | route: {route} | action: {action}",
"strategy_plugin_name_crisis_response_shadow": "Crisis Response Shadow",
"strategy_plugin_line": "🧩 Plugin: {plugin} | status: {route} | notice: {action}",
"strategy_plugin_name_crisis_response_shadow": "Crisis Watch Notice",
"strategy_plugin_mode_shadow": "shadow",
"strategy_plugin_route_no_action": "no action",
"strategy_plugin_route_no_action": "no crisis detected",
"strategy_plugin_route_true_crisis": "true crisis",
"strategy_plugin_route_taco_fake_crisis": "TACO fake crisis",
"strategy_plugin_route_unknown_route": "unknown route",
"strategy_plugin_route_unknown_route": "unknown status",
"strategy_plugin_action_no_action": "no action",
"strategy_plugin_action_watch_only": "watch only",
"strategy_plugin_action_watch_only": "notify only",
"strategy_plugin_action_small_taco": "small TACO",
"strategy_plugin_action_defend": "defend",
"strategy_plugin_action_blocked": "blocked",
"strategy_plugin_action_monitor": "monitor",
"strategy_plugin_action_unknown_action": "unknown action",
"strategy_plugin_action_monitor": "watch",
"strategy_plugin_action_unknown_action": "unknown notice",
"strategy_name_tqqq_growth_income": "TQQQ Growth Income",
"strategy_name_soxl_soxx_trend_income": "SOXL/SOXX Semiconductor Trend Income",
"strategy_name_global_etf_rotation": "Global ETF Rotation",
Expand Down
11 changes: 5 additions & 6 deletions tests/test_request_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,9 @@ def test_strategy_plugin_notification_line_uses_i18n(self):
lines = module.build_strategy_plugin_notification_lines((signal,))

self.assertEqual(len(lines), 1)
self.assertIn("插件:危机响应观察", lines[0])
self.assertIn("模式:影子观察", lines[0])
self.assertIn("路由:不操作", lines[0])
self.assertIn("建议:仅观察", lines[0])
self.assertIn("插件:危机观察通知", lines[0])
self.assertIn("状态:未触发危机", lines[0])
self.assertIn("提醒:仅通知", lines[0])

def test_strategy_plugin_notification_line_renders_triggered_shadow_signal(self):
module = load_module(notify_lang="zh")
Expand All @@ -396,8 +395,8 @@ def test_strategy_plugin_notification_line_renders_triggered_shadow_signal(self)
lines = module.build_strategy_plugin_notification_lines((signal,))

self.assertEqual(len(lines), 1)
self.assertIn("路由:真危机", lines[0])
self.assertIn("建议:防守", lines[0])
self.assertIn("状态:真危机", lines[0])
self.assertIn("提醒:防守", lines[0])

def test_handle_schwab_reports_plugin_config_error_without_blocking_strategy(self):
mount_config = json.dumps(
Expand Down