Skip to content

Commit

Permalink
added test for check args in skill
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCox822 committed Dec 20, 2023
1 parent 589e7e8 commit 6d6ac11
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,16 @@ def test_execute_skill_function(skill_manager):
with pytest.raises(ValueError) as excinfo:
skill_manager.execute_skill_function("nonexistent_tool", path_registry)
assert "Code for nonexistent_tool not found" in str(excinfo.value)


def test_check_arguments_success(skill_manager):
skill_manager.skills = {
"sample_tool": {"arguments": [{"name": "arg1"}, {"name": "arg2"}]}
}
try:
skill_manager._check_arguments("sample_tool", arg1=5, arg2=10)
except ValueError:
pytest.fail("ValueError raised unexpectedly")
with pytest.raises(ValueError) as excinfo:
skill_manager._check_arguments("sample_tool", arg1=5)
assert "Missing arguments" in str(excinfo.value)

0 comments on commit 6d6ac11

Please sign in to comment.