Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Sep 12, 2024
1 parent 69ef1d1 commit 2764e15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion tests/agents/test_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ def test_agent_model_from_string(self):
assert isinstance(agent2.model, ChatAnthropic)
assert agent2.model.model == "claude-3-haiku-20240307"

def test_agent_model_with_invalid_format(self):
with pytest.raises(ValueError, match="The model `gpt-4o` is not valid."):
Agent(model="gpt-4o")

def test_agent_model_from_unsupported_provider(self):
with pytest.raises(ValueError, match="Unsupported model provider: abc"):
with pytest.raises(
ValueError, match="Could not load provider `abc` automatically"
):
Agent(model="abc/def")

def test_agent_loads_instructions_at_creation(self):
Expand Down
6 changes: 3 additions & 3 deletions tests/llm/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def test_get_groq_model():
assert model.model_name == "mixtral-8x7b-32768"


def test_get_model_with_bad_format():
with pytest.raises(ValueError, match="The model `xyz` is not valid."):
get_model("xyz")
def test_get_model_with_invalid_format():
with pytest.raises(ValueError, match="The model `gpt-4o` is not valid."):
get_model("gpt-4o")


def test_get_model_with_unsupported_provider():
Expand Down

0 comments on commit 2764e15

Please sign in to comment.