From fe5262e13e129f93bf9890d68900d19d29c17b04 Mon Sep 17 00:00:00 2001 From: Alexandre Quintart Date: Mon, 18 Mar 2024 14:24:15 +0100 Subject: [PATCH] changed the shock checkbox test --- tests/test_gui.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_gui.py b/tests/test_gui.py index 6a8a7af..ecb0e73 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -87,9 +87,12 @@ def test_toggle_display_shock_checkbox(app, qtbot): """ Test the functionality of the 'Show Shock' checkbox. """ - initial_state = app.ui.checkBox_display_shock.setChecked(True) + app.ui.checkBox_display_shock.setChecked(True) + initial_state = app.ui.checkBox_display_shock.isChecked() qtbot.mouseClick(app.ui.checkBox_display_shock, Qt.LeftButton) assert app.ui.checkBox_display_shock.isChecked() != initial_state + qtbot.mouseClick(app.ui.checkBox_display_shock, Qt.LeftButton) + assert app.ui.checkBox_display_shock.isChecked() == initial_state def test_switch_tabs(app, qtbot): @@ -405,9 +408,12 @@ def test_set_mask_nframes(app, qtbot): def test_toggle_display_shock_2(app, qtbot, mocker): test_load_analysis_files(app, qtbot, mocker) - initial_state = app.ui.checkBox_display_shock2.setChecked(True) + app.ui.checkBox_display_shock2.setChecked(True) + initial_state = app.ui.checkBox_display_shock2.isChecked() qtbot.mouseClick(app.ui.checkBox_display_shock2, Qt.LeftButton) assert app.ui.checkBox_display_shock2.isChecked() != initial_state + qtbot.mouseClick(app.ui.checkBox_display_shock2, Qt.LeftButton) + assert app.ui.checkBox_display_shock2.isChecked() == initial_state def test_switch_to_fitting_params_tab(app, qtbot):