Skip to content

Commit 6b305fc

Browse files
committed
fixup! Add yaml obs converter
Emphasize order in tests as we have ordered the yaml now
1 parent 70ee5fb commit 6b305fc

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

tests/ert/unit_tests/cli/test_summary_to_yaml.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_that_no_summary_observations_raises_ert_cli_error():
8282

8383

8484
def test_that_observations_with_same_summary_key_are_gathered_in_yaml_dict(use_tmpdir):
85-
k1, k2 = "foo", "bar"
85+
k1, k2 = "bar", "foo"
8686
observations = 2 * [
8787
_make_obs_dict(key=k1, well=""),
8888
_make_obs_dict(key=k2, well=""),
@@ -92,15 +92,14 @@ def test_that_observations_with_same_summary_key_are_gathered_in_yaml_dict(use_t
9292
summary_dicts = converter._summary_to_yaml_dict()
9393

9494
keys = [entry["key"] for entry in summary_dicts["smry"]]
95-
assert len(keys) == 2
96-
assert set(keys) == {k1, k2}
95+
assert keys == [k1, k2]
9796

9897
observations = [s_d["observations"] for s_d in summary_dicts["smry"]]
9998
assert all(len(o) == 2 for o in observations)
10099

101100

102101
def test_that_observations_with_different_summary_keys_are_separated_in_yaml_dict():
103-
k1, k2 = "foo", "bar"
102+
k1, k2 = "bar", "foo"
104103
observations = [
105104
_make_obs_dict(key=k1, well=""),
106105
_make_obs_dict(key=k2, well=""),
@@ -110,8 +109,7 @@ def test_that_observations_with_different_summary_keys_are_separated_in_yaml_dic
110109
result = converter._summary_to_yaml_dict()
111110

112111
keys = [entry["key"] for entry in result["smry"]]
113-
assert len(keys) == 2
114-
assert set(keys) == {k1, k2}
112+
assert keys == [k1, k2]
115113

116114

117115
def test_that_dumping_to_yaml_is_skipped_when_file_already_exists(use_tmpdir):

0 commit comments

Comments
 (0)