Fixed tests

This commit is contained in:
Fahad
2025-06-12 13:51:22 +04:00
parent 79af2654b9
commit 354a0fae0b
6 changed files with 48 additions and 39 deletions

View File

@@ -2,6 +2,7 @@
Test that conversation history is correctly mapped to tool-specific fields
"""
import os
from datetime import datetime
from unittest.mock import MagicMock, patch
@@ -129,12 +130,17 @@ async def test_unknown_tool_defaults_to_prompt():
with patch("utils.conversation_memory.get_thread", return_value=mock_context):
with patch("utils.conversation_memory.add_turn", return_value=True):
with patch("utils.conversation_memory.build_conversation_history", return_value=("History", 500)):
arguments = {
"continuation_id": "test-thread-456",
"prompt": "User input",
}
with patch.dict(os.environ, {"GEMINI_API_KEY": "test-key", "OPENAI_API_KEY": ""}, clear=False):
from providers.registry import ModelProviderRegistry
enhanced_args = await reconstruct_thread_context(arguments)
ModelProviderRegistry.clear_cache()
arguments = {
"continuation_id": "test-thread-456",
"prompt": "User input",
}
enhanced_args = await reconstruct_thread_context(arguments)
# Should default to 'prompt' field
assert "prompt" in enhanced_args