Skip to content

Commit 01a20e3

Browse files
committed
refactor(tests): reorganize test agent and tool files into fixtures
Moved test agents and tools to a dedicated fixtures directory. Updated test scripts to reference the new file paths. Removed obsolete test agent and tool files. Improved instructions for running tests.
1 parent ed3a689 commit 01a20e3

4 files changed

Lines changed: 13 additions & 59 deletions

File tree

src/praisonai/tests/test_custom_tools_fix.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,20 @@ def calculate(expression: str) -> str:
6767
'''
6868

6969
# Write the test files
70-
with open("test_agents.yaml", "w") as f:
70+
import os
71+
FIXTURES_DIR = os.path.join(os.path.dirname(__file__), "fixtures")
72+
os.makedirs(FIXTURES_DIR, exist_ok=True)
73+
74+
with open(os.path.join(FIXTURES_DIR, "test_agents.yaml"), "w") as f:
7175
f.write(agents_yaml_content)
7276

73-
with open("test_tools.py", "w") as f:
77+
with open(os.path.join(FIXTURES_DIR, "test_tools.py"), "w") as f:
7478
f.write(tools_py_content)
7579

76-
print("Test files created successfully!")
80+
print("Test files created successfully in tests/fixtures/!")
7781
print("\nTo test the fix:")
78-
print("1. Copy test_agents.yaml to agents.yaml")
79-
print("2. Copy test_tools.py to tools.py")
82+
print("1. Copy tests/fixtures/test_agents.yaml to agents.yaml")
83+
print("2. Copy tests/fixtures/test_tools.py to tools.py")
8084
print("3. Run the chatbot UI")
8185
print("4. Ask the agent to use multiple tools")
8286
print("\nThe agent should now be able to use all three tools (search_web, get_weather, calculate)")

src/praisonai/tests/unit/test_enhanced_auto.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,12 @@ def test_generated_yaml_includes_tools(self):
121121
from praisonai.auto import AutoGenerator
122122

123123
# Test that the generator has tool discovery capability
124+
import os
125+
fixture_path = os.path.join(os.path.dirname(__file__), "..", "fixtures", "test_agents.yaml")
126+
124127
generator = AutoGenerator(
125128
topic="Search the web for AI news and write a summary",
126-
agent_file="test_agents.yaml",
129+
agent_file=fixture_path,
127130
framework="praisonai"
128131
)
129132

test_agents.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

test_tools.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)