forked from FoundationAgents/OpenManus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple_test_runner.py
More file actions
87 lines (63 loc) · 2.39 KB
/
simple_test_runner.py
File metadata and controls
87 lines (63 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env python3
"""
Simple test runner to verify test structure works.
"""
import asyncio
import sys
from pathlib import Path
# Add the project root to Python path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))
def test_basic_imports():
"""Test that we can import our test modules."""
try:
# Test basic test framework imports
from tests.base import IntegrationTestCase, UnitTestCase
print("✓ Test base classes imported successfully")
# Test schema imports (core functionality)
from app.schema import Memory, Message, Role
print("✓ Schema classes imported successfully")
# Test exceptions
from app.exceptions import OpenManusError
print("✓ Exception classes imported successfully")
return True
except Exception as e:
print(f"✗ Import failed: {e}")
return False
def test_basic_functionality():
"""Test basic functionality without external dependencies."""
try:
# Test Memory class
from app.schema import Memory, Message, Role
memory = Memory()
user_msg = Message.user_message("Hello")
memory.add_message(user_msg)
assert len(memory.messages) == 1
assert memory.messages[0].role == Role.USER
print("✓ Memory functionality works")
return True
except Exception as e:
print(f"✗ Basic functionality test failed: {e}")
return False
def main():
"""Run basic tests to verify setup."""
print("Running basic test verification...")
import_success = test_basic_imports()
if not import_success:
sys.exit(1)
functionality_success = test_basic_functionality()
if not functionality_success:
sys.exit(1)
print("\n✓ All basic tests passed! Test environment is ready.")
print("\nTest files created:")
print("- tests/unit/test_agent_manus.py (Unit tests for Manus agent)")
print(
"- tests/integration/test_tool_execution.py (Tool execution integration tests)"
)
print("- tests/integration/test_mcp_connectivity.py (MCP connectivity tests)")
print("- tests/integration/test_memory_management.py (Memory management tests)")
print("\nTo run specific tests:")
print("python -m pytest tests/unit/ -v --tb=short")
print("python -m pytest tests/integration/ -v --tb=short")
if __name__ == "__main__":
main()