mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-23 15:18:14 +00:00
fix(tests): fix multimodal and before_kickoff_callback tests
- Mock supports_multimodal() to return False in image tool test since AddImageTool is only added when LLM doesn't natively support multimodal - Remove incorrect assertion that expected original inputs dict to be modified (it's copied internally before modification)
This commit is contained in:
@@ -4038,7 +4038,11 @@ def test_multimodal_agent_image_tool_handling():
|
||||
messages=[],
|
||||
)
|
||||
|
||||
with patch.object(Task, "execute_sync") as mock_execute_sync:
|
||||
# Mock supports_multimodal to return False so AddImageTool gets added
|
||||
with (
|
||||
patch.object(Task, "execute_sync") as mock_execute_sync,
|
||||
patch.object(multimodal_agent.llm, "supports_multimodal", return_value=False),
|
||||
):
|
||||
# Set up the mock to return our task output
|
||||
mock_execute_sync.return_value = mock_task_output
|
||||
|
||||
@@ -4315,9 +4319,9 @@ def test_before_kickoff_callback():
|
||||
# Call kickoff
|
||||
test_crew.kickoff(inputs=inputs)
|
||||
|
||||
# Check that the before_kickoff function was called and modified inputs
|
||||
# Check that the before_kickoff function was called
|
||||
# Note: inputs is copied internally, so the original dict is not modified
|
||||
assert test_crew_instance.inputs_modified
|
||||
assert inputs.get("modified")
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
|
||||
Reference in New Issue
Block a user