-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_app.py
More file actions
48 lines (39 loc) · 1.46 KB
/
Copy pathtest_app.py
File metadata and controls
48 lines (39 loc) · 1.46 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
#!/usr/bin/env python
"""
Test file to verify our minimal app works correctly
"""
import os
import sys
import traceback
# Add src directory to path
script_dir = os.path.dirname(os.path.abspath(__file__))
src_dir = os.path.join(script_dir, 'src')
if src_dir not in sys.path:
sys.path.insert(0, src_dir)
def main():
"""Main entry point for the application."""
try:
from PyQt5.QtWidgets import QApplication
from gui.dxf_meta_app_minimal import DXFMetaApp
print("✓ Successfully imported DXFMetaApp")
app = QApplication([])
app.setApplicationName("DXF Metadata Viewer - Test")
main_window = DXFMetaApp()
print("✓ Successfully created DXFMetaApp instance")
# Test one method to see if it works
result = main_window.select_folder()
print(f"✓ Select folder returned: {result}")
# Test the find_module_by_filepath method too
filepath = "C:/path/to/test.dxf"
result = main_window.find_module_by_filepath(filepath)
print(f"✓ find_module_by_filepath returned: {result}")
print("\nAll tests passed! The minimal app works.")
return 0
except Exception as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
print(f"Error: {str(e)}")
traceback.print_exception(exc_type, exc_value, exc_traceback)
print("\nThe minimal app did not work correctly.")
return 1
if __name__ == "__main__":
sys.exit(main())