mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-27 17:18:13 +00:00
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:
@@ -75,7 +75,9 @@ class TestIntegrationLLMFeatures:
|
|||||||
)
|
)
|
||||||
|
|
||||||
with patch.object(lite_agent, '_invoke_loop') as mock_invoke:
|
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")
|
result = lite_agent.kickoff("Analyze this problem")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user