refactor: centralize settings and application services
This commit is contained in:
@@ -3,10 +3,12 @@ from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
from typing import Any
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
from telegram.constants import ParseMode
|
||||
|
||||
from assistant_bot.handlers import private_voice
|
||||
from assistant_bot.services import SERVICES_KEY, ApplicationServices
|
||||
from assistant_bot.telegram_utils import render_markdown_chunks
|
||||
|
||||
|
||||
@@ -31,8 +33,14 @@ class VoiceHandlerTests(unittest.IsolatedAsyncioTestCase):
|
||||
bot=bot,
|
||||
application=SimpleNamespace(
|
||||
bot_data={
|
||||
"speech_recognizer": recognizer,
|
||||
"voice_max_duration": 120,
|
||||
SERVICES_KEY: ApplicationServices(
|
||||
storage=SimpleNamespace(),
|
||||
ai_client=SimpleNamespace(),
|
||||
timezone=ZoneInfo("UTC"),
|
||||
speech_recognizer=recognizer,
|
||||
voice_max_duration_seconds=120,
|
||||
assistant_password="secret",
|
||||
),
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user