Skip to content

Commit

Permalink
Fix restart test to expect the total number of realizations when rest…
Browse files Browse the repository at this point in the history
…art happens
  • Loading branch information
xjules committed Sep 13, 2024
1 parent 1896b65 commit 3495366
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/unit_tests/gui/test_restart_ensemble_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)

0 comments on commit 3495366

Please sign in to comment.