Skip to content

Commit

Permalink
TST: added download simulation test
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilo9999 committed May 1, 2024
1 parent d8aea6f commit f80aaee
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions hnn_core/tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,3 +563,41 @@ def add_child_decorated(self, to_add):
# Check if the widgets are relinked, the selected index should be synced
gui.tab_group_1.selected_index = 0
assert gui.tab_group_2.selected_index == 0


def test_gui_download_simulation():
"""Test the GUI download simulation pipeline."""
gui = HNNGUI()
_ = gui.compose()
gui.params['N_pyr_x'] = 3
gui.params['N_pyr_y'] = 3

# Run a simulation with 3 trials
gui.widget_dt.value = 0.85
gui.widget_ntrials.value = 3

# set synch inputs to first driver in simulation
sim_name = "sim1"
gui.widget_simulation_name.value = sim_name

# Run simulation
gui.run_button.click()
serialized_simulation_data, file_extension = (
gui.viz_manager.serialize_simulation(sim_name))
# result is a zip file
assert file_extension == ".zip"

# Run a simulation with 1 trials
gui.widget_dt.value = 0.85
gui.widget_ntrials.value = 1

# set synch inputs to first driver in simulation
sim_name2 = "sim2"
gui.widget_simulation_name.value = sim_name2

# Run simulation
gui.run_button.click()
serialized_simulation_data, file_extension = (
gui.viz_manager.serialize_simulation(sim_name2))
# result is a single csv file
assert file_extension == ".csv"

0 comments on commit f80aaee

Please sign in to comment.