Skip to content

Commit

Permalink
Fix args passed to CaseOnDisk (#100)
Browse files Browse the repository at this point in the history
* Fix args passed to CaseOnDisk

* Use /search to validate uploaded objects
  • Loading branch information
equinor-ruaj authored Sep 26, 2024
1 parent dcdf7b5 commit 97818be
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def _fix_register(scratch_files, token):
yaml.safe_dump(case_metadata, stream)
sumo_conn = SumoConnection(env="dev", token=token)
case = CaseOnDisk(
case_metadata_path=case_metadata_path,
sumo_connection=sumo_conn,
case_metadata_path,
sumo_conn,
verbosity="DEBUG",
)
# Register the case in Sumo
Expand Down
26 changes: 24 additions & 2 deletions tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,30 @@ def test_sim2sumo_with_ert(scratch_files, case_uuid, sumo, monkeypatch):
real0 = scratch_files[0]
write_ert_config_and_run(real0)
expected_exports = 88
path = f"/objects('{case_uuid}')/children"
results = sumo.get(path).json()
path = f"/objects('{case_uuid}')/search"
results = sumo.post(
path,
json={
"query": {
"bool": {
"must_not": [
{
"terms": {
"class.keyword": [
"case",
"iteration",
"realization",
]
}
}
],
}
},
"size": 0,
"track_total_hits": True,
},
).json()

returned = results["hits"]["total"]["value"]
LOGGER.debug("This is returned %s", returned)
assert (
Expand Down

0 comments on commit 97818be

Please sign in to comment.