test: add comprehensive TelegramClient tests (issue #32) #37

Merged
jihoson merged 1 commits from feature/issue-32-telegram-tests into main 2026-02-04 21:33:19 +09:00
Collaborator

Summary

  • 15 tests across 5 test classes
  • TestTelegramClientInit (4 tests)
  • TestNotificationSending (6 tests)
  • TestRateLimiting (1 test)
  • TestMessagePriorities (2 tests)
  • TestClientCleanup (2 tests)

Test Coverage

  • Disabled scenarios (missing credentials, disabled flag)
  • Message format verification
  • API error handling (400, timeout, connection errors)
  • Session management (creation, reuse)
  • Rate limiter enforcement
  • Priority emoji verification
  • Graceful degradation

Implementation Details

  • Uses pytest.mark.asyncio for async tests
  • Mocks aiohttp responses with AsyncMock
  • Follows test patterns from test_broker.py
  • All error scenarios covered

🤖 Generated with Claude Code

## Summary - ✅ 15 tests across 5 test classes - ✅ TestTelegramClientInit (4 tests) - ✅ TestNotificationSending (6 tests) - ✅ TestRateLimiting (1 test) - ✅ TestMessagePriorities (2 tests) - ✅ TestClientCleanup (2 tests) ## Test Coverage - Disabled scenarios (missing credentials, disabled flag) - Message format verification - API error handling (400, timeout, connection errors) - Session management (creation, reuse) - Rate limiter enforcement - Priority emoji verification - Graceful degradation ## Implementation Details - Uses pytest.mark.asyncio for async tests - Mocks aiohttp responses with AsyncMock - Follows test patterns from test_broker.py - All error scenarios covered ## Related Issues - Closes #32 - Part 2 of 5 for Telegram notification system - Next: Issue #33 (config), #34 (main.py integration), #35 (docs) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agentson added 1 commit 2026-02-04 21:32:40 +09:00
test: add comprehensive TelegramClient tests (issue #32)
Some checks failed
CI / test (pull_request) Has been cancelled
ed26915562
Add 15 tests across 5 test classes:
- TestTelegramClientInit (4 tests): disabled scenarios, enabled with credentials
- TestNotificationSending (6 tests): disabled mode, message format, API errors, timeouts, session management
- TestRateLimiting (1 test): rate limiter enforcement
- TestMessagePriorities (2 tests): priority emoji verification
- TestClientCleanup (2 tests): session cleanup

Uses pytest.mark.asyncio for async tests.
Mocks aiohttp responses with AsyncMock.
Follows test patterns from test_broker.py.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
jihoson merged commit 6c96f9ac64 into main 2026-02-04 21:33:19 +09:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#37