File: test_throw.py

package info (click to toggle)
opm-simulators 2025.10%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,460 kB
  • sloc: cpp: 193,029; sh: 1,807; python: 1,704; lisp: 1,108; makefile: 31; awk: 10
file content (18 lines) | stat: -rw-r--r-- 652 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import os
import unittest
from pathlib import Path
from .pytest_common import pushd, create_black_oil_simulator

class TestBasic(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        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 = create_black_oil_simulator(filename="SPE1CASE1.DATA")
            # NOTE: The following call should throw an exception since the simulation
            #   has not been initialized
            with self.assertRaises(RuntimeError):
                sim.get_dt()