Skip to content

Commit

Permalink
Update test_result_gui_viewer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
toruseo committed Mar 26, 2024
1 parent cae0684 commit b6b7742
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tests/test_result_gui_viewer.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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_())

0 comments on commit b6b7742

Please sign in to comment.