Skip to content

Commit

Permalink
tests: Refactored test_gui_visualization to remove parametrization so…
Browse files Browse the repository at this point in the history
… simulations are not run for each iteration.
  • Loading branch information
gtdang committed May 9, 2024
1 parent 33f9adb commit ae0f405
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions hnn_core/tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,24 +479,25 @@ def test_gui_adaptive_spectrogram(setup_gui):
plt.close('all')


@pytest.mark.parametrize("viz_type", ["layer2 dipole", "layer5 dipole",
"spikes", "PSD", "network"])
def test_gui_visualization(setup_gui, viz_type):
def test_gui_visualization(setup_gui):
"""Test visualization functionality in the HNNGUI."""
gui = setup_gui
gui.run_button.click()

figid = 1
figname = f'Figure {figid}'
axname = 'ax1'
gui._simulate_viz_action("edit_figure", figname,
axname, 'default', viz_type, {}, 'clear')
gui._simulate_viz_action("edit_figure", figname,
axname, 'default', viz_type, {}, 'plot')
# Check if data is plotted on the axes
assert len(gui.viz_manager.figs[figid].axes) == 2
# Check default figs have data on their axis
assert gui.viz_manager.figs[figid].axes[1].has_data()

plot_types = ["layer2 dipole", "layer5 dipole", "spikes", "PSD", "network"]
for viz_type in plot_types:
gui._simulate_viz_action("edit_figure", figname,
axname, 'default', viz_type, {}, 'clear')
gui._simulate_viz_action("edit_figure", figname,
axname, 'default', viz_type, {}, 'plot')
# Check if data is plotted on the axes
assert len(gui.viz_manager.figs[figid].axes) == 2
# Check default figs have data on their axis
assert gui.viz_manager.figs[figid].axes[1].has_data()


def test_unlink_relink_widget():
Expand Down

0 comments on commit ae0f405

Please sign in to comment.