1.0.0 Release
This commit is contained in:
47
tests/test_dialog.py
Normal file
47
tests/test_dialog.py
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test script to verify options dialog works correctly
|
||||
"""
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0, '/Users/JeThomas/scripts/HereIAm/src')
|
||||
|
||||
from PyQt5 import QtWidgets
|
||||
from options_dialog import OptionsDialog
|
||||
|
||||
def test_dialog_multiple_opens():
|
||||
print("Testing multiple dialog opens...")
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
|
||||
# Test opening dialog multiple times
|
||||
for i in range(3):
|
||||
print(f"Opening dialog #{i+1}")
|
||||
|
||||
dialog = OptionsDialog(
|
||||
current_wait_time=240 + i*10,
|
||||
current_start_enabled=True,
|
||||
current_log_level="INFO",
|
||||
current_move_px=10 + i
|
||||
)
|
||||
|
||||
# Show dialog briefly (simulate quick open/close)
|
||||
dialog.show()
|
||||
app.processEvents() # Process pending events
|
||||
|
||||
# Get values to ensure dialog is functional
|
||||
values = dialog.get_values()
|
||||
print(f"Dialog #{i+1} values: {values}")
|
||||
|
||||
# Close dialog
|
||||
dialog.close()
|
||||
dialog.deleteLater()
|
||||
app.processEvents() # Process cleanup events
|
||||
|
||||
print(f"Dialog #{i+1} closed successfully")
|
||||
|
||||
print("Multiple dialog test completed successfully!")
|
||||
app.quit()
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_dialog_multiple_opens()
|
||||
Reference in New Issue
Block a user