Repository navigation
Expand file tree
/
Copy pathtest_system.py
More file actions
87 lines (73 loc) · 2.21 KB
/
Copy pathtest_system.py
File metadata and controls
87 lines (73 loc) · 2.21 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
"""
Quick system validation test.
"""
import sys
def test_imports():
"""Test all critical imports."""
print("Testing imports...")
try:
import fastapi
print(f"✅ FastAPI {fastapi.__version__}")
except Exception as e:
print(f"❌ FastAPI: {e}")
return False
try:
import langchain
print(f"✅ LangChain {langchain.__version__}")
except Exception as e:
print(f"❌ LangChain: {e}")
return False
try:
import pytest
print(f"✅ Pytest {pytest.__version__}")
except Exception as e:
print(f"❌ Pytest: {e}")
return False
try:
from src.schemas import DealState, DealStage
print(f"✅ Schemas loaded (DealState, DealStage)")
except Exception as e:
print(f"❌ Schemas: {e}")
return False
try:
from src.config import get_settings
settings = get_settings()
print(f"✅ Config loaded (env: {settings.ENVIRONMENT})")
except Exception as e:
print(f"❌ Config: {e}")
return False
return True
def test_basic_functionality():
"""Test basic functionality."""
print("\nTesting basic functionality...")
try:
from src.schemas import DealState
# Try to import without creating instance
print("✅ DealState class available")
except Exception as e:
print(f"❌ DealState: {e}")
return False
return True
if __name__ == "__main__":
print("=" * 60)
print("SYSTEM VALIDATION TEST")
print("=" * 60)
print()
imports_ok = test_imports()
functionality_ok = test_basic_functionality()
print()
print("=" * 60)
if imports_ok and functionality_ok:
print("🎉 SYSTEM IS WORKING!")
print("=" * 60)
print()
print("Next steps:")
print("1. Install remaining dependencies: pip install pytest-cov httpx celery redis")
print("2. Run tests: pytest tests/unit/test_imports.py -v")
print("3. Start API: uvicorn src.api.main:app --reload")
sys.exit(0)
else:
print("❌ SYSTEM HAS ISSUES")
print("=" * 60)
sys.exit(1)