Files
python-sdk/pkg/hanzo/test_node.py
T
zeekay b90e7752eb feat: improved hanzo/net integration with proper dependency checks
- Added net_check utility for verifying hanzo/net installation
- Improved error handling and dependency detection
- Added comprehensive tests for node command
- Set up CI/CD workflows for both projects
- Better handling of venv and Python paths
2025-08-06 21:18:39 -05:00

58 lines
1.6 KiB
Python

#!/usr/bin/env python
"""Standalone test for hanzo node command."""
import sys
import os
# Add src to path
sys.path.insert(0, "src")
def test_imports():
"""Test that modules can be imported."""
try:
from hanzo.utils.net_check import check_net_installation, get_missing_dependencies
print("✓ Successfully imported net_check utilities")
# Test the check function
is_available, net_path, python_exe = check_net_installation()
print(f"✓ Net available: {is_available}")
print(f" Net path: {net_path}")
print(f" Python: {python_exe}")
if python_exe:
missing = get_missing_dependencies(python_exe)
if missing:
print(f" Missing deps: {', '.join(missing[:5])}")
else:
print(" All dependencies installed")
return True
except Exception as e:
print(f"✗ Import failed: {e}")
return False
def test_cli_import():
"""Test CLI import."""
try:
from hanzo.cli import start_compute_node
print("✓ Successfully imported CLI")
return True
except Exception as e:
print(f"✗ CLI import failed: {e}")
return False
if __name__ == "__main__":
print("Testing Hanzo Node Command Integration")
print("=" * 40)
success = True
success = test_imports() and success
success = test_cli_import() and success
print("=" * 40)
if success:
print("✓ All tests passed!")
sys.exit(0)
else:
print("✗ Some tests failed")
sys.exit(1)