-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_structure.py
More file actions
90 lines (69 loc) · 2.9 KB
/
test_structure.py
File metadata and controls
90 lines (69 loc) · 2.9 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
88
89
90
#!/usr/bin/env python3
"""Test script to verify project structure is set up correctly."""
import sys
from pathlib import Path
# Add src to path
sys.path.insert(0, str(Path(__file__).parent / 'src'))
def test_imports():
"""Test that all modules can be imported."""
print("Testing imports...")
try:
# Core imports
from shadow_it_generator import __version__
print(f"✓ Package version: {__version__}")
from shadow_it_generator.core import LogGenerator, SessionGenerator, UserManager
print("✓ Core modules imported")
from shadow_it_generator.config import ConfigLoader, EnterpriseConfig, CloudService
print("✓ Config modules imported")
from shadow_it_generator.services import ServiceManager, ServiceCategory
print("✓ Services modules imported")
from shadow_it_generator.formatters import LogFormatter, LEEFFormatter, CEFFormatter
print("✓ Formatter modules imported")
from shadow_it_generator.utils import setup_logging, FileHandler, IPGenerator
print("✓ Utils modules imported")
from shadow_it_generator.generators import UserAgentGenerator, ResponseGenerator
print("✓ Generator modules imported")
from shadow_it_generator.main import cli
print("✓ CLI imported")
print("\nAll imports successful!")
return True
except ImportError as e:
print(f"✗ Import error: {e}")
return False
def check_structure():
"""Check that all expected directories and files exist."""
print("\nChecking project structure...")
expected_files = [
'setup.py',
'requirements.txt',
'requirements-dev.txt',
'main.py',
'src/shadow_it_generator/__init__.py',
'src/shadow_it_generator/main.py',
'src/shadow_it_generator/core/__init__.py',
'src/shadow_it_generator/config/__init__.py',
'src/shadow_it_generator/services/__init__.py',
'src/shadow_it_generator/formatters/__init__.py',
'src/shadow_it_generator/utils/__init__.py',
'src/shadow_it_generator/generators/__init__.py',
]
project_root = Path(__file__).parent
all_exist = True
for file_path in expected_files:
full_path = project_root / file_path
if full_path.exists():
print(f"✓ {file_path}")
else:
print(f"✗ {file_path} - NOT FOUND")
all_exist = False
return all_exist
if __name__ == '__main__':
print("Shadow IT Log Generator - Structure Test\n")
structure_ok = check_structure()
imports_ok = test_imports()
if structure_ok and imports_ok:
print("\n✓ Project structure is set up correctly!")
sys.exit(0)
else:
print("\n✗ There are issues with the project structure.")
sys.exit(1)