Problem Statement
Zero test files exist in quantara/web_app/telegram/. The Telegram bot handles notification delivery for liquidation alerts — critical for user position safety — but has no test coverage for message formatting, notification delivery, or subscription management.
Evidence
quantara/web_app/telegram/ directory has no test_ files
- No tests for
notifications.py, texts.py, markups.py, config.py, __main__.py
quantara/web_app/tests/ has no Telegram-related test files
Impact
High — untested critical path. Telegram bot failures (missed liquidation alerts, incorrect notifications) go undetected. Users may miss critical position warnings. Notification delivery is a core safety feature for leveraged positions.
Proposed Solution
Add unit tests for: message formatting (texts.py, markups.py), notification delivery logic (notifications.py). Add integration tests for subscription/unsubscription flow with mocked Telegram Bot API.
Acceptance Criteria
File Map
quantara/web_app/tests/test_telegram.py — New: unit tests
quantara/web_app/test_integration/test_telegram.py — New: integration tests
Testing Strategy
- Unit: Test
texts.py message templates, markups.py keyboard generation, notifications.py send logic with mocked bot
- Integration: Test Telegram webhook handling and user subscription flow
Security Considerations
Ensure tests don't send real Telegram messages. Use mocked bot API.
Definition of Done
Labels: testing
Priority: High
Difficulty: Intermediate
Estimated Effort: 1d
Problem Statement
Zero test files exist in
quantara/web_app/telegram/. The Telegram bot handles notification delivery for liquidation alerts — critical for user position safety — but has no test coverage for message formatting, notification delivery, or subscription management.Evidence
quantara/web_app/telegram/directory has notest_filesnotifications.py,texts.py,markups.py,config.py,__main__.pyquantara/web_app/tests/has no Telegram-related test filesImpact
High — untested critical path. Telegram bot failures (missed liquidation alerts, incorrect notifications) go undetected. Users may miss critical position warnings. Notification delivery is a core safety feature for leveraged positions.
Proposed Solution
Add unit tests for: message formatting (
texts.py,markups.py), notification delivery logic (notifications.py). Add integration tests for subscription/unsubscription flow with mocked Telegram Bot API.Acceptance Criteria
texts.pyandmarkups.pynotifications.pyaioresponsesorhttpxmockFile Map
quantara/web_app/tests/test_telegram.py— New: unit testsquantara/web_app/test_integration/test_telegram.py— New: integration testsTesting Strategy
texts.pymessage templates,markups.pykeyboard generation,notifications.pysend logic with mocked botSecurity Considerations
Ensure tests don't send real Telegram messages. Use mocked bot API.
Definition of Done
Labels: testing
Priority: High
Difficulty: Intermediate
Estimated Effort: 1d