mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
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 <joao@crewai.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user