-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_basic.py
More file actions
66 lines (56 loc) · 1.56 KB
/
test_basic.py
File metadata and controls
66 lines (56 loc) · 1.56 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
"""
Basic test script to verify the application components are working correctly.
"""
import os
import sys
from unittest.mock import MagicMock
# Add the project root to the Python path
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
# Mock various modules that might be missing
modules_to_mock = [
'ollama',
'cv2',
'easyocr',
'pytesseract',
'pdf2image',
'spacy',
'transformers',
'torch',
'playwright',
'selenium',
'undetected_chromedriver'
]
for module_name in modules_to_mock:
sys.modules[module_name] = MagicMock()
# Try importing key modules
try:
import streamlit
print("✅ Streamlit imported successfully")
except ImportError as e:
print(f"❌ Failed to import Streamlit: {e}")
try:
import fastapi
print("✅ FastAPI imported successfully")
except ImportError as e:
print(f"❌ Failed to import FastAPI: {e}")
try:
from app.main import coBoarding
print("✅ coBoarding class imported successfully")
# Create an instance to verify basic functionality
app = coBoarding()
print("✅ coBoarding instance created successfully")
except ImportError as e:
print(f"❌ Failed to import coBoarding class: {e}")
print("Detailed error:")
import traceback
traceback.print_exc()
except Exception as e:
print(f"❌ Error creating coBoarding instance: {e}")
print("Detailed error:")
import traceback
traceback.print_exc()
# Print Python path for debugging
print("\nPython path:")
for path in sys.path:
print(f"- {path}")
print("\nTest completed.")