Add comprehensive unit tests for all command handlers: - TestHelperFunctions: is_group, get_group_id, get_user_id, get_room_id - TestCmdBounty: lists bounties, handles empty - TestCmdMy: shows tracked in groups, personal in DM - TestCmdAdd: add bounty success, validation - TestCmdUpdate: update bounty, permission denied, invalid ID - TestCmdDelete: delete bounty, invalid ID - TestCmdTrack: track in group, reject in DM - TestCmdUntrack: untrack in group, reject in DM - TestCmdStart: group vs DM behavior - TestCmdHelp: shows all commands Also fix conftest.py to remove obsolete fresh_db fixture that referenced non-existent db module. All 55 tests pass. Addresses han's feedback on PR #33
11 lines
237 B
Python
11 lines
237 B
Python
"""Pytest fixtures for telegram-bot tests."""
|
|
|
|
import sys
|
|
import tempfile
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
# Add the app directory to path so imports work when running pytest
|
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|