Fixed mock comparison error

This commit is contained in:
Fahad
2025-06-14 09:34:56 +04:00
parent 746380eb7f
commit 2c805d6637

View File

@@ -129,7 +129,20 @@ 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)):
# The autouse fixture should handle provider mocking
# Mock ModelContext to avoid calculation errors
with patch("utils.model_context.ModelContext") as mock_model_context_class:
mock_model_context = MagicMock()
mock_model_context.model_name = "gemini-2.5-flash-preview-05-20"
mock_model_context.calculate_token_allocation.return_value = MagicMock(
total_tokens=200000,
content_tokens=120000,
response_tokens=80000,
file_tokens=48000,
history_tokens=48000,
available_for_prompt=24000,
)
mock_model_context_class.from_arguments.return_value = mock_model_context
arguments = {
"continuation_id": "test-thread-456",
"prompt": "User input",