opm-simulators/python/test/test_throw.py
Håkon Hægland ac927d997b Added a get_dt() method
Added a get_dt() to the opm.simulators.BlackOilSimulator Python module.
This will return the size of the previous simulator time step.
2023-09-08 19:40:42 +02:00

23 lines
840 B
Python

import os
import unittest
from pathlib import Path
from opm.simulators import BlackOilSimulator
from .pytest_common import pushd
class TestBasic(unittest.TestCase):
@classmethod
def setUpClass(cls):
# NOTE: See comment in test_basic.py for the reason why we are
# only using a single test_all() function instead of splitting
# it up in multiple test functions
test_dir = Path(os.path.dirname(__file__))
cls.data_dir = test_dir.parent.joinpath("test_data/SPE1CASE1a")
def test_all(self):
with pushd(self.data_dir):
sim = BlackOilSimulator("SPE1CASE1.DATA")
# NOTE: The following call should throw an exception since the simulation
# has not been initialized
with self.assertRaises(RuntimeError):
sim.get_dt()