diff --git a/tests/integration/test_commands.py b/tests/integration/test_commands.py new file mode 100644 index 0000000..108367b --- /dev/null +++ b/tests/integration/test_commands.py @@ -0,0 +1,22 @@ +""" +Интеграционные тесты для команд бота (проверяют вызовы RAGClient). +""" + +import pytest +from unittest.mock import AsyncMock, MagicMock + +# Импортируем команды +from core.commands.clear import ClearCommand +from core.commands.kb import KbCommand +# ... и другие + +@pytest.mark.asyncio +async def test_clear_command(): + bot = MagicMock() + bot.rag_client = AsyncMock() + bot.rag_client.clear = AsyncMock(return_value={"status": "ok"}) + cmd = ClearCommand(bot) + msg = MagicMock() + msg.reply.return_value = MagicMock() + await cmd.execute(msg, "", "user@domain", None) + bot.rag_client.clear.assert_called_once_with("user@domain", None, False) \ No newline at end of file