From 3495366a4142bd1a51efb9b23422ac271015bdb7 Mon Sep 17 00:00:00 2001 From: xjules Date: Fri, 13 Sep 2024 15:23:50 +0200 Subject: [PATCH] Fix restart test to expect the total number of realizations when restart happens --- .../gui/test_restart_ensemble_experiment.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/unit_tests/gui/test_restart_ensemble_experiment.py b/tests/unit_tests/gui/test_restart_ensemble_experiment.py index 45d218aaa54..116cf977948 100644 --- a/tests/unit_tests/gui/test_restart_ensemble_experiment.py +++ b/tests/unit_tests/gui/test_restart_ensemble_experiment.py @@ -113,13 +113,15 @@ def handle_dialog(): qtbot.waitUntil(run_dialog.restart_button.isVisible, timeout=60000) qtbot.waitUntil(lambda: run_dialog._tab_widget.currentWidget() is not None) - # Assert that the number of boxes in the detailed view is - # equal to the number of previously failed realizations + # We expect to have the same amount of realizations in list_model + # since we reuse the snapshot_model realization_widget = run_dialog._tab_widget.currentWidget() assert isinstance(realization_widget, RealizationWidget) list_model = realization_widget._real_view.model() assert list_model - assert list_model.rowCount() == len(failed_realizations) + assert ( + list_model.rowCount() == experiment_panel.config.model_config.num_realizations + ) # Second restart assert any(run_dialog._run_model._create_mask_from_failed_realizations()) @@ -142,12 +144,14 @@ def handle_dialog(): qtbot.waitUntil(run_dialog.done_button.isVisible, timeout=60000) qtbot.waitUntil(lambda: run_dialog._tab_widget.currentWidget() is not None) - # Assert that the number of boxes in the detailed view is - # equal to the number of previously failed realizations + # We expect to have the same amount of realizations in list_model + # since we reuse the snapshot_model realization_widget = run_dialog._tab_widget.currentWidget() assert isinstance(realization_widget, RealizationWidget) list_model = realization_widget._real_view.model() assert list_model - assert list_model.rowCount() == len(failed_realizations) + assert ( + list_model.rowCount() == experiment_panel.config.model_config.num_realizations + ) qtbot.mouseClick(run_dialog.done_button, Qt.MouseButton.LeftButton)