-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
User
committed
May 22, 2024
1 parent
a018298
commit 5fee363
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |