Skip to content

Commit

Permalink
prtvol2csv test against latest flow/eclipse simulator output
Browse files Browse the repository at this point in the history
  • Loading branch information
alifbe committed Aug 26, 2024
1 parent a2c579a commit 25fa864
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/test_prtvol2csv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test prtvol2csv, both as library and as command line"""

import os
import shutil
import subprocess
import sys
from pathlib import Path
Expand All @@ -13,8 +14,45 @@

from subscript.prtvol2csv import prtvol2csv

from .utils import run_simulator

TESTDATADIR = Path(__file__).absolute().parent / "data/reek/eclipse/model"

DROGON_TEST_DATA_DIR = Path(__file__).absolute().parent / "data/drogon/eclipse"


def test_valid_flow_output(simulator, tmp_path, mocker):
"""Test that latest simulation output from flow can be processed"""

shutil.copytree(DROGON_TEST_DATA_DIR, tmp_path / "eclipse")
os.chdir(tmp_path / "eclipse/model")

Path(tmp_path / "eclipse/include/schedule/drogon_hist.sch").write_text(
"""
TSTEP
0.0001 /
/
END
""", # noqa
encoding="utf8",
)
run_simulator(simulator, Path(tmp_path / "eclipse/model/DROGON-0.DATA"))

with pytest.warns(FutureWarning, match="Output directories"):
mocker.patch(
"sys.argv",
[
"prtvol2csv",
"--debug",
str(Path(tmp_path / "eclipse/model/DROGON-0.PRT")),
],
)
prtvol2csv.main()
dframe = pd.read_csv("share/results/volumes/simulator_volume_fipnum.csv")

assert dframe.shape == (21, 13)


def test_currently_in_place_from_prt(tmp_path):
"""Test parsing of PRT to find currently in place"""
Expand Down

0 comments on commit 25fa864

Please sign in to comment.