-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_backend.py
More file actions
47 lines (37 loc) · 1.32 KB
/
test_backend.py
File metadata and controls
47 lines (37 loc) · 1.32 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
#!/usr/bin/env python3
"""
Test script to verify the backend can be imported and started correctly.
Run this locally to test if there are any import errors.
"""
import sys
import os
# Add current directory to Python path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
print("=" * 60)
print("NEEL Backend Import Test")
print("=" * 60)
print(f"\nPython version: {sys.version}")
print(f"Current directory: {os.getcwd()}")
print(f"Python path: {sys.path[:3]}")
try:
print("\n1. Testing backend.main import...")
from backend.main import app
print(" ✅ backend.main imported successfully")
print("\n2. Checking FastAPI app...")
print(f" App title: {app.title}")
print(f" App version: {app.version}")
print("\n3. Checking routes...")
routes = [r.path for r in app.routes if hasattr(r, 'path')]
print(f" Total routes: {len(routes)}")
print(f" Sample routes: {routes[:10]}")
# Check for specific routes
auth_routes = [r for r in routes if '/api/auth' in r]
print(f"\n4. Auth routes found: {len(auth_routes)}")
for route in auth_routes:
print(f" - {route}")
print("\n✅ All tests passed! Backend should work on Render.")
except Exception as e:
print(f"\n❌ Error: {e}")
import traceback
traceback.print_exc()
sys.exit(1)