Fix LiteAgent test mocking: return AgentFinish object instead of raw string

- Mock _invoke_loop to return proper AgentFinish object with output attribute
- This should resolve the 'str' object has no attribute 'output' error in CI

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-06-24 05:38:46 +00:00
parent b1ae914cd3
commit 76fea442d4

View File

@@ -75,7 +75,9 @@ class TestIntegrationLLMFeatures:
)
with patch.object(lite_agent, '_invoke_loop') as mock_invoke:
mock_invoke.return_value = response_with_xml
from crewai.agents.agent_action import AgentFinish
mock_agent_finish = AgentFinish(output=response_with_xml, text=response_with_xml)
mock_invoke.return_value = mock_agent_finish
result = lite_agent.kickoff("Analyze this problem")