-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
45 lines (36 loc) · 1.35 KB
/
Copy pathtest.py
File metadata and controls
45 lines (36 loc) · 1.35 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
"""
Simple test script to verify the select_folder fix
This script tests if our fix for the select_folder method works correctly
by simulating the signal connection and calls.
"""
# Add the src directory to the path
import os
import sys
src_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'src')
root_dir = os.path.dirname(src_dir)
if root_dir not in sys.path:
sys.path.insert(0, root_dir)
from PyQt5.QtWidgets import QApplication
def test_select_folder():
"""Test if our fix for select_folder works correctly."""
try:
# Just import the DXFMetaApp to check if it loads without errors
from src.gui.app import DXFMetaApp
print("✓ Successfully imported DXFMetaApp")
# Create a minimal application
app = QApplication([])
# Create the main window
main_window = DXFMetaApp()
print("✓ Successfully created DXFMetaApp instance")
# Test calling on_select_folder instead of the old select_folder method
main_window.on_select_folder()
print("✓ Successfully called on_select_folder")
print("\nAll tests passed! The fix works.")
return 0
except Exception as e:
print(f"Error: {str(e)}")
print("\nThe fix did not work correctly.")
return 1
if __name__ == "__main__":
# Run the test
sys.exit(test_select_folder())