-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_imports.py
More file actions
74 lines (65 loc) · 2.14 KB
/
test_imports.py
File metadata and controls
74 lines (65 loc) · 2.14 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
#!/usr/bin/env python3
"""
Test that all enhanced modules can be imported correctly
"""
def test_core_imports():
"""Test core module imports"""
try:
from shellrosetta.core import lnx2ps, ps2lnx, get_translation_stats
print("✅ Core module imports successful")
return True
except ImportError as e:
print(f"❌ Core module import failed: {e}")
return False
def test_security_imports():
"""Test security module imports"""
try:
from shellrosetta.security import CommandValidator, SecurityLevel
print("✅ Security module imports successful")
return True
except ImportError as e:
print(f"❌ Security module import failed: {e}")
return False
def test_performance_imports():
"""Test performance module imports"""
try:
from shellrosetta.performance import cached, get_memory_cache
print("✅ Performance module imports successful")
return True
except ImportError as e:
print(f"❌ Performance module import failed: {e}")
return False
def test_logging_imports():
"""Test logging module imports"""
try:
from shellrosetta.logging_config import get_logger, RequestContext
print("✅ Logging module imports successful")
return True
except ImportError as e:
print(f"❌ Logging module import failed: {e}")
return False
def test_api_imports():
"""Test API module imports"""
try:
from shellrosetta.api import run_api_server
print("✅ API module imports successful")
return True
except ImportError as e:
print(f"❌ API module import failed: {e}")
return False
if __name__ == "__main__":
print("🧪 Testing Module Imports")
print("=" * 40)
tests = [
test_core_imports,
test_security_imports,
test_performance_imports,
test_logging_imports,
test_api_imports
]
results = [test() for test in tests]
if all(results):
print("\n🎉 All imports successful!")
else:
print("\n❌ Some imports failed!")
print("Check the error messages above.")