From 97818bec9b6adb7deed5dbd62fbc2c70f6bcc973 Mon Sep 17 00:00:00 2001 From: Runar Ask Johannessen <89020325+equinor-ruaj@users.noreply.github.com> Date: Thu, 26 Sep 2024 09:40:17 +0200 Subject: [PATCH] Fix args passed to CaseOnDisk (#100) * Fix args passed to CaseOnDisk * Use /search to validate uploaded objects --- tests/conftest.py | 4 ++-- tests/test_functions.py | 26 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0f55c27..da3c265 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 diff --git a/tests/test_functions.py b/tests/test_functions.py index 4a3cec1..15ee744 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -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 (