Skip to content

Commit

Permalink
add test tool chain
Browse files Browse the repository at this point in the history
  • Loading branch information
User committed May 22, 2024
1 parent a018298 commit 5fee363
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_tools/test_tool_chain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import pytest

from motleycrew.tools import MotleyTool


class ToolMock:
def invoke(self, input_dict: dict, *args, **kwargs):
return input_dict


@pytest.fixture
def tools():
tool1 = MotleyTool(ToolMock())
tool2 = MotleyTool(ToolMock())
return [tool1, tool2]


def test_tool_chain(tools):
tool1, tool2 = tools
tool_chain = tool1 | tool2
assert hasattr(tool_chain, "invoke")
prompt = {"prompt": "test prompt"}
assert tool_chain.invoke(prompt) == prompt

0 comments on commit 5fee363

Please sign in to comment.