-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_imports.py
More file actions
64 lines (55 loc) · 1.92 KB
/
test_imports.py
File metadata and controls
64 lines (55 loc) · 1.92 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
#!/usr/bin/env python3
"""Test script to diagnose import issues"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
print("Step 1: Importing basic modules...")
try:
from PyQt6.QtWidgets import QApplication
from PyQt6.QtCore import Qt
print("✓ PyQt6 imported successfully")
except Exception as e:
print(f"✗ PyQt6 import failed: {e}")
sys.exit(1)
print("\nStep 2: Importing integration manager...")
try:
from backend.integrations.integration_manager import IntegrationManager, IntegrationConfig
print("✓ IntegrationManager imported successfully")
except Exception as e:
print(f"✗ IntegrationManager import failed: {e}")
import traceback
traceback.print_exc()
sys.exit(1)
print("\nStep 3: Creating IntegrationConfig...")
try:
config = IntegrationConfig(api_enabled=True, api_port=8080)
print(f"✓ Config created: api_enabled={config.api_enabled}")
except Exception as e:
print(f"✗ Config creation failed: {e}")
import traceback
traceback.print_exc()
sys.exit(1)
print("\nStep 4: Creating IntegrationManager...")
try:
manager = IntegrationManager(config)
print(f"✓ IntegrationManager created")
print(f" - API server: {manager.api_server}")
except Exception as e:
print(f"✗ IntegrationManager creation failed: {e}")
import traceback
traceback.print_exc()
sys.exit(1)
print("\nStep 5: Testing API server start...")
if manager.api_server:
try:
result = manager.api_server.start()
print(f"✓ API server start result: {result}")
if result:
print(f" - Server running: {manager.api_server.is_running()}")
except Exception as e:
print(f"✗ API server start failed: {e}")
import traceback
traceback.print_exc()
else:
print("✗ No API server available")
print("\nAll tests completed!")