diff --git a/tests/ert/unit_tests/gui/conftest.py b/tests/ert/unit_tests/gui/conftest.py index 2d8908601b6..e47d20b5f3b 100644 --- a/tests/ert/unit_tests/gui/conftest.py +++ b/tests/ert/unit_tests/gui/conftest.py @@ -24,6 +24,7 @@ def full_snapshot() -> EnsembleSnapshot: real = RealizationSnapshot( status=REALIZATION_STATE_RUNNING, active=True, + exec_hosts="COMP-01", fm_steps={ "0": FMStepSnapshot( start_time=dt.now(), diff --git a/tests/ert/unit_tests/gui/model/test_snapshot.py b/tests/ert/unit_tests/gui/model/test_snapshot.py index d81f9728d32..9d3747fd509 100644 --- a/tests/ert/unit_tests/gui/model/test_snapshot.py +++ b/tests/ert/unit_tests/gui/model/test_snapshot.py @@ -62,3 +62,29 @@ def test_snapshot_model_data_intact_on_full_update(full_snapshot, fail_snapshot) first_real = model.index(0, 0, model.index(0, 0)) assert first_real.internalPointer().children["0"].data["status"] == "Finished" + + +@pytest.mark.parametrize( + "do_update, expected_value", + [ + pytest.param( + True, + "COMP-01", + id="Host assigned", + ), + pytest.param( + False, + None, + id="No host assigned", + ), + ], +) +def test_snapshot_model_exec_hosts_propagated(full_snapshot, do_update, expected_value): + model = SnapshotModel() + model._add_snapshot(SnapshotModel.prerender(full_snapshot), "0") + + if do_update: + model._update_snapshot(SnapshotModel.prerender(full_snapshot), "0") + + first_real = model.index(0, 0, model.index(0, 0)) + assert first_real.internalPointer().data.exec_hosts == expected_value