Fix #4: Extract send() to module-level send_telegram_message() for testability #19
Reference in New Issue
Block a user
Delete Branch "fix/issue-4-telegram-token-refactor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Refactor the nested
send()function into a module-levelsend_telegram_message()to enable unit testing.Changes
scripts/browse.py: Extractsend()→send_telegram_message(bot_token, chat_id, text, timeout=10)tests/test_browse.py: 8 unit tests covering success, API errors, network errors, timeout, etc..gitignore: +.worktrees/Test Results
Fixes
Ref: #4
lgtm