-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
d8b43de
commit 6b5f966
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,26 @@ | ||
""" | ||
The tool documentations in `tools_settings` are LLM generated, to ensure | ||
the correct JSON format is generated every time a new tool is added this | ||
test verifies the tool can be correctly loaded. | ||
> Discovering it when after building the Docker API is a pain in the ass | ||
""" | ||
import unittest | ||
from pathlib import Path | ||
from src.agent.tools.base import Tool | ||
|
||
|
||
class TestToolIntegration(unittest.TestCase): | ||
BASE_PATH = Path('../../tools_settings') | ||
|
||
def test_load(self): | ||
"""Try to load tool and fail if any exception is raised""" | ||
try: | ||
for path in Path(self.BASE_PATH).iterdir(): | ||
if path.is_file() and path.suffix == '.json': | ||
Tool.load_tool(str(path)) | ||
except Exception as err: | ||
self.fail(f'Tool Integration failed.\n{err}') | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |