Skip to content

Commit

Permalink
fixup! remove slow test - eivind
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin-krasontovitsch committed Aug 30, 2023
1 parent 2053fb0 commit e02530e
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions tests/unit_tests/test_load_forward_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import fileinput
import logging
import os
from datetime import datetime
from pathlib import Path
from textwrap import dedent
Expand Down Expand Up @@ -39,49 +37,6 @@ def run_simulator(time_step_count, start_date) -> EclSum:
return ecl_sum


@pytest.mark.usefixtures("copy_snake_oil_case_storage")
def test_load_inconsistent_time_map_summary(caplog):
"""
Checking that we dont util_abort, we fail the forward model instead
"""
cwd = os.getcwd()

# Get rid of GEN_DATA as we are only interested in SUMMARY
with fileinput.input("snake_oil.ert", inplace=True) as fin:
for line in fin:
if line.startswith("GEN_DATA"):
continue
print(line, end="")

facade = LibresFacade.from_config_file("snake_oil.ert")
realisation_number = 0
storage = open_storage(facade.enspath, mode="w")
ensemble = storage.get_ensemble_by_name("default_0")
assert (
ensemble.state_map[realisation_number] == RealizationState.HAS_DATA
) # Check prior state

# Create a result that is incompatible with the refcase
run_path = Path("storage") / "snake_oil" / "runpath" / "realization-0" / "iter-0"
os.chdir(run_path)
ecl_sum = run_simulator(1, datetime(2000, 1, 1))
ecl_sum.fwrite()
os.chdir(cwd)

realizations = [False] * facade.get_ensemble_size()
realizations[realisation_number] = True
with caplog.at_level(logging.WARNING):
loaded = facade.load_from_forward_model(ensemble, realizations, 0)
assert (
"Realization: 0, load warning: 1 inconsistencies in time map, first: "
"Time mismatch for step: 1, response time: 2000-01-10 00:00:00, "
"reference case: 2010-01-10 00:00:00, last: Time mismatch for step: "
"1, response time: 2000-01-10 00:00:00, reference case: 2010-01-10 "
f"00:00:00 from: {run_path.absolute()}/SNAKE_OIL_FIELD.UNSMRY"
) in caplog.messages
assert loaded == 1


@pytest.mark.usefixtures("copy_snake_oil_case_storage")
def test_load_forward_model(snake_oil_default_storage):
"""
Expand Down

0 comments on commit e02530e

Please sign in to comment.