Skip to content

Commit

Permalink
Add snapshot test for propagating exec_hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Oct 4, 2024
1 parent fe28933 commit e88d5ff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/ert/unit_tests/gui/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
26 changes: 26 additions & 0 deletions tests/ert/unit_tests/gui/model/test_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e88d5ff

Please sign in to comment.