From ce44f3bc0970d1804661f7f2f1678119731c16d5 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:52:57 +0000 Subject: [PATCH] test: Add test for agent creation without model prices - Add test to verify agent creation works without model prices - Mock get_provider_data to return None - Verify agent is created successfully Part of #2116 Co-Authored-By: Joe Moura --- tests/agent_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/agent_test.py b/tests/agent_test.py index e67a7454a..f08c37487 100644 --- a/tests/agent_test.py +++ b/tests/agent_test.py @@ -78,6 +78,18 @@ def test_agent_default_values(): assert agent.llm.model == "gpt-4o-mini" assert agent.allow_delegation is False +@pytest.mark.vcr(filter_headers=["authorization"]) +def test_agent_creation_without_model_prices(): + with patch('crewai.cli.provider.get_provider_data') as mock_get: + mock_get.return_value = None + agent = Agent( + role="test role", + goal="test goal", + backstory="test backstory" + ) + assert agent is not None + assert agent.role == "test role" + def test_custom_llm(): agent = Agent(