diff --git a/notifications/telegram.py b/notifications/telegram.py index 63a5248..b7189a9 100644 --- a/notifications/telegram.py +++ b/notifications/telegram.py @@ -71,6 +71,7 @@ "strategy_name_russell_1000_multi_factor_defensive": "罗素1000多因子", "strategy_name_tech_communication_pullback_enhancement": "科技通信回调增强", "strategy_name_qqq_tech_enhancement": "科技通信回调增强", + "strategy_name_mega_cap_leader_rotation_aggressive": "Mega Cap 激进龙头轮动", "strategy_name_mega_cap_leader_rotation_dynamic_top20": "Mega Cap 动态 Top20 龙头轮动", "strategy_name_dynamic_mega_leveraged_pullback": "Mega Cap 2x 回调策略", "strategy_name_tqqq_growth_income": "TQQQ 增长收益", @@ -143,6 +144,7 @@ "strategy_name_russell_1000_multi_factor_defensive": "Russell 1000 Multi-Factor", "strategy_name_tech_communication_pullback_enhancement": "Tech/Communication Pullback Enhancement", "strategy_name_qqq_tech_enhancement": "Tech/Communication Pullback Enhancement", + "strategy_name_mega_cap_leader_rotation_aggressive": "Mega Cap Leader Rotation Aggressive", "strategy_name_mega_cap_leader_rotation_dynamic_top20": "Mega Cap Leader Rotation Dynamic Top20", "strategy_name_dynamic_mega_leveraged_pullback": "Dynamic Mega Leveraged Pullback", "strategy_name_tqqq_growth_income": "TQQQ Growth Income", diff --git a/tests/test_notifications.py b/tests/test_notifications.py index 605ed3d..5ef517f 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py @@ -1,4 +1,5 @@ from notifications.telegram import build_strategy_display_name, build_translator, send_telegram_message +from strategy_registry import SUPPORTED_STRATEGY_PROFILES def test_build_translator_supports_chinese(): @@ -24,12 +25,23 @@ def test_strategy_display_name_translates_new_live_profiles(): zh_name = build_strategy_display_name(build_translator("zh")) en_name = build_strategy_display_name(build_translator("en")) + assert zh_name("mega_cap_leader_rotation_aggressive") == "Mega Cap 激进龙头轮动" assert zh_name("mega_cap_leader_rotation_dynamic_top20") == "Mega Cap 动态 Top20 龙头轮动" assert zh_name("dynamic_mega_leveraged_pullback") == "Mega Cap 2x 回调策略" + assert en_name("mega_cap_leader_rotation_aggressive") == "Mega Cap Leader Rotation Aggressive" assert en_name("mega_cap_leader_rotation_dynamic_top20") == "Mega Cap Leader Rotation Dynamic Top20" assert en_name("dynamic_mega_leveraged_pullback") == "Dynamic Mega Leveraged Pullback" +def test_supported_strategy_profiles_have_translated_names(): + zh_name = build_strategy_display_name(build_translator("zh")) + en_name = build_strategy_display_name(build_translator("en")) + + for profile in SUPPORTED_STRATEGY_PROFILES: + assert zh_name(profile) != profile + assert en_name(profile) != profile + + def test_send_telegram_message_logs_non_200_response(capsys): class FakeResponse: status_code = 401