Skip to content

Commit

Permalink
Make test agnostic to manifest order
Browse files Browse the repository at this point in the history
  • Loading branch information
Yngve S. Kristiansen committed Sep 10, 2024
1 parent 4b8c547 commit ba3b1d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions tests/unit_tests/gui/tools/test_manage_experiments_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,8 @@ def test_realization_view(
realization_widget = tool._storage_info_widget._content_layout.currentWidget()

assert realization_widget._state_label.text() == "Realization state: HAS_DATA"
assert (
realization_widget._response_text_edit.toPlainText()
== "\ngen_data - HAS_DATA\nsummary - HAS_DATA\n"
assert {"gen_data - HAS_DATA", "summary - HAS_DATA"}.issubset(
set(realization_widget._response_text_edit.toPlainText().splitlines())
)
assert (
realization_widget._parameter_text_edit.toPlainText()
Expand Down
6 changes: 3 additions & 3 deletions tests/unit_tests/test_run_path_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,17 +682,17 @@ def test_crete_runpath_adds_manifest_to_runpath(snake_oil_case, storage, itr):
if run_arg.active
]
exp_runpaths = list(map(os.path.realpath, exp_runpaths))
expected_manifest_values = [
expected_manifest_values = {
"snake_oil_params.txt",
"snake_oil_opr_diff_199.txt",
"snake_oil_wpr_diff_199.txt",
"snake_oil_gpr_diff_199.txt",
"SNAKE_OIL_FIELD.UNSMRY",
"SNAKE_OIL_FIELD.SMSPEC",
]
}
for run_path in exp_runpaths:
manifest_path = Path(run_path) / "manifest.json"
assert manifest_path.exists()
with open(manifest_path, encoding="utf-8") as f:
manifest = orjson.loads(f.read())
assert list(manifest.values()) == expected_manifest_values
assert set(manifest.values()) == expected_manifest_values

0 comments on commit ba3b1d0

Please sign in to comment.