Files
timmy-local/test_harness.py
Allegro f71e31585b Initial Uni-Wizard architecture
- Single harness for all API interactions
- Unified tool registry with routing
- System, Git, Network tool layers
- Local-first, self-healing design
2026-03-30 17:15:11 +00:00

115 lines
2.8 KiB
Python

#!/usr/bin/env python3
"""
Test script for Uni-Wizard Harness
Exercises all tool categories
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
from harness import get_harness
def test_system_tools():
"""Test system monitoring tools"""
print("\n" + "="*60)
print("TESTING SYSTEM TOOLS")
print("="*60)
harness = get_harness()
tests = [
("system_info", {}),
("health_check", {}),
("process_list", {"filter_name": "python"}),
("disk_usage", {}),
]
for tool_name, params in tests:
print(f"\n>>> {tool_name}()")
result = harness.execute(tool_name, **params)
print(result[:500] + "..." if len(result) > 500 else result)
def test_git_tools():
"""Test git operations"""
print("\n" + "="*60)
print("TESTING GIT TOOLS")
print("="*60)
harness = get_harness()
# Test with timmy-home repo if it exists
repo_path = "/tmp/timmy-home"
tests = [
("git_status", {"repo_path": repo_path}),
("git_log", {"repo_path": repo_path, "count": 5}),
("git_branch_list", {"repo_path": repo_path}),
]
for tool_name, params in tests:
print(f"\n>>> {tool_name}()")
result = harness.execute(tool_name, **params)
print(result[:500] + "..." if len(result) > 500 else result)
def test_network_tools():
"""Test network operations"""
print("\n" + "="*60)
print("TESTING NETWORK TOOLS")
print("="*60)
harness = get_harness()
tests = [
("http_get", {"url": "http://143.198.27.163:3000/api/v1/repos/Timmy_Foundation/timmy-home"}),
("gitea_list_issues", {"state": "open"}),
]
for tool_name, params in tests:
print(f"\n>>> {tool_name}()")
result = harness.execute(tool_name, **params)
print(result[:500] + "..." if len(result) > 500 else result)
def test_harness_features():
"""Test harness management features"""
print("\n" + "="*60)
print("TESTING HARNESS FEATURES")
print("="*60)
harness = get_harness()
print("\n>>> list_capabilities()")
print(harness.list_capabilities())
print("\n>>> get_status()")
print(harness.get_status())
def run_all_tests():
"""Run complete test suite"""
print("UNI-WIZARD HARNESS TEST SUITE")
print("=============================")
try:
test_system_tools()
test_git_tools()
test_network_tools()
test_harness_features()
print("\n" + "="*60)
print("✓ ALL TESTS COMPLETED")
print("="*60)
except Exception as e:
print(f"\n✗ TEST FAILED: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
run_all_tests()