-
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
Showing
12 changed files
with
48 additions
and
11 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
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
1 change: 1 addition & 0 deletions
1
libs/agentc_core/tests/catalog/resources/scan_files/.agentcignore
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 @@ | ||
prompts/prompt2.prompt |
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions
2
libs/agentc_core/tests/catalog/resources/scan_files/tools/.agentcignore
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,2 @@ | ||
prompt1.jinja | ||
tool2.yaml |
Empty file.
Empty file.
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,32 @@ | ||
import os | ||
import pathlib | ||
|
||
from agentc_core.catalog.directory import scan_directory | ||
from agentc_core.defaults import DEFAULT_SCAN_DIRECTORY_OPTS | ||
from agentc_core.indexer.indexer import AllIndexers | ||
|
||
|
||
def test_scan_dir_tools(): | ||
root_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "resources", "scan_files") | ||
source_globs = [i.glob_pattern for i in AllIndexers if all(k.is_tool() for k in i.kind)] | ||
output = [] | ||
output += scan_directory(root_dir, "tools", source_globs, opts=DEFAULT_SCAN_DIRECTORY_OPTS) | ||
|
||
assert ( | ||
pathlib.PosixPath(os.path.join(root_dir, "tools", "tool3.sqlpp")) in output | ||
and pathlib.PosixPath(os.path.join(root_dir, "tools", "tool4.py")) in output | ||
and pathlib.PosixPath(os.path.join(root_dir, "tools", "tool2.sqlpp")) not in output | ||
and pathlib.PosixPath(os.path.join(root_dir, "tool1.py")) not in output | ||
) | ||
|
||
|
||
def test_scan_dir_prompts(): | ||
root_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "resources", "scan_files") | ||
source_globs = [i.glob_pattern for i in AllIndexers if all(k.is_prompt() for k in i.kind)] | ||
output = [] | ||
output += scan_directory(root_dir, "prompts", source_globs, opts=DEFAULT_SCAN_DIRECTORY_OPTS) | ||
|
||
assert ( | ||
pathlib.PosixPath(os.path.join(root_dir, "prompts", "prompt1.jinja")) in output | ||
and pathlib.PosixPath(os.path.join(root_dir, "prompts", "prompt2.prompt")) not in output | ||
) |