mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-26 09:10:59 -06:00
a1b7d4b5dd
Allows the Python bindings to control whether MPI_Init() and MPI_Finalize() will be called when creating an OPM::Main object.
24 lines
841 B
Python
24 lines
841 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()
|
|
|