diff --git a/tests/test_result_gui_viewer.py b/tests/test_result_gui_viewer.py index e041738..ad375ec 100644 --- a/tests/test_result_gui_viewer.py +++ b/tests/test_result_gui_viewer.py @@ -1,16 +1,10 @@ """ This script tests ResultGUIViewer. +This is for local test only. I don't know how to test it in Github Actions properly. """ import pytest -def test_OSMImporter(): - import uxsim as UX - from uxsim.OSMImporter import OSMImporter - print(OSMImporter.import_osm_data) - print(OSMImporter.osm_network_postprocessing) - - def test_result_gui_viewer(): import uxsim as UX from uxsim.ResultGUIViewer import ResultGUIViewer @@ -42,4 +36,14 @@ def test_result_gui_viewer(): # Print summary of simulation result W.analyzer.print_simple_stats() - ResultGUIViewer.launch_World_viewer(W, return_app_window=False) + app, window = ResultGUIViewer.launch_World_viewer(W, return_app_window=True) + + # Shut down 5 sec later + from PyQt5.QtCore import QTimer + import sys + timer = QTimer() + timer.timeout.connect(window.close) + timer.start(1000*5) + assert True + with pytest.raises(SystemExit): + sys.exit(app.exec_()) \ No newline at end of file