Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Sep 11, 2024
1 parent 00fabd4 commit d7c3f4d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit_tests/gui/tools/plot/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,18 @@ def mocked_requests_get(*args, **kwargs):
"userdata": {"data_origin": "GEN_DATA"},
"has_observations": False,
},
"FOPRH": {
"name": "FOPRH",
"id": "id_997",
"userdata": {"data_origin": "Summary"},
"has_observations": True,
},
"FOPRH:1,3,8": {
"name": "FOPRH:1,3,8",
"id": "id_998",
"userdata": {"data_origin": "Summary"},
"has_observations": True,
},
},
"/ensembles/ens_id_3/responses": {
"BPR:1,3,8": {
Expand Down
29 changes: 29 additions & 0 deletions tests/unit_tests/gui/tools/plot/test_plot_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def test_key_def_structure(api):
"metadata": {"data_origin": "Summary"},
"observations": True,
"log_scale": False,
"history_vector": False,
}
assert fopr == PlotApiKeyDefinition(**fopr_expected)

Expand All @@ -28,6 +29,7 @@ def test_key_def_structure(api):
"metadata": {"data_origin": "Summary"},
"observations": False,
"log_scale": False,
"history_vector": False,
}
assert bpr == PlotApiKeyDefinition(**bpr_expected)

Expand All @@ -41,9 +43,34 @@ def test_key_def_structure(api):
"metadata": {"data_origin": "GEN_KW"},
"observations": False,
"log_scale": False,
"history_vector": False,
}
assert bpr_parameter == PlotApiKeyDefinition(**bpr_parameter_expected)

foprh = next(x for x in key_defs if x.key == "FOPRH")
foprh_expected = {
"dimensionality": 2,
"index_type": "VALUE",
"key": "FOPRH",
"metadata": {"data_origin": "Summary"},
"observations": True,
"log_scale": False,
"history_vector": True,
}
assert foprh == PlotApiKeyDefinition(**foprh_expected)

foprh = next(x for x in key_defs if x.key == "FOPRH:1,3,8")
foprh_expected = {
"dimensionality": 2,
"index_type": "VALUE",
"key": "FOPRH:1,3,8",
"metadata": {"data_origin": "Summary"},
"observations": True,
"log_scale": False,
"history_vector": True,
}
assert foprh == PlotApiKeyDefinition(**foprh_expected)


def test_case_structure(api):
ensembles = [ensemble.name for ensemble in api.get_all_ensembles()]
Expand Down Expand Up @@ -90,6 +117,8 @@ def test_all_data_type_keys(api):
"BPR:1,3,8",
"FOPR",
"SNAKE_OIL_WPR_DIFF@199",
"FOPRH",
"FOPRH:1,3,8",
"SNAKE_OIL_PARAM:BPR_138_PERSISTENCE",
"SNAKE_OIL_PARAM:OP1_DIVERGENCE_SCALE",
"WOPPER",
Expand Down

0 comments on commit d7c3f4d

Please sign in to comment.