From 5a21aeee14eb43d2da17253b6a621e2ce12562b7 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Sat, 11 Jul 2026 21:35:58 +0800 Subject: [PATCH] chore: remove test scripts --- _test_tg.py | 26 -------------------------- _test_verify.py | 23 ----------------------- 2 files changed, 49 deletions(-) delete mode 100644 _test_tg.py delete mode 100644 _test_verify.py diff --git a/_test_tg.py b/_test_tg.py deleted file mode 100644 index 112c4aa..0000000 --- a/_test_tg.py +++ /dev/null @@ -1,26 +0,0 @@ -import yaml, requests, json - -with open("config.yaml", "r", encoding="utf-8") as f: - cfg = yaml.safe_load(f) - -token = cfg["telegram"]["bot_token"] -chat_id = cfg["telegram"]["chat_id"] - -# 测试1: 纯文本无 parse_mode -payload = { - "chat_id": chat_id, - "text": "🔑 Kraken 701383\n账户: test@test.com", - "reply_markup": {"inline_keyboard": [[{"text": "查看原文", "callback_data": "v"}, {"text": "回复", "callback_data": "r"}]]}, -} -print("=== Test 1: plain text, no parse_mode ===") -r = requests.post(f"https://api.telegram.org/bot{token}/sendMessage", json=payload, timeout=10) -print(r.status_code, r.text[:300]) - -# 测试2: 不带 reply_markup -payload2 = { - "chat_id": chat_id, - "text": "🔑 Kraken 701383\n账户: test@test.com", -} -print("\n=== Test 2: no keyboard ===") -r2 = requests.post(f"https://api.telegram.org/bot{token}/sendMessage", json=payload2, timeout=10) -print(r2.status_code, r2.text[:300]) diff --git a/_test_verify.py b/_test_verify.py deleted file mode 100644 index 29d0db9..0000000 --- a/_test_verify.py +++ /dev/null @@ -1,23 +0,0 @@ -import json -from src.tg_bot import format_summary, _summary_keyboard - -data = { - 'subject': '确认码', - 'recipient': 'test@test.com', - 'sender': 'Kraken ', - 'category': 'notification', - 'summary': 'Kraken确认码', - 'verification_code': 'Kraken 701383', - 'links': [], - 'can_reply': False, - 'reply_suggestions': [] -} - -text = format_summary(data, 'test@test.com') -kb = _summary_keyboard(False, False, []) - -print('=== text ===') -print(repr(text)) -print() -print('=== keyboard ===') -print(json.dumps(kb, ensure_ascii=False, indent=2))