diff --git a/python/tests/test_connection.py b/python/tests/test_connection.py index 776457afe..c1a5701fa 100644 --- a/python/tests/test_connection.py +++ b/python/tests/test_connection.py @@ -3,13 +3,16 @@ import unittest from opm.io.parser import Parser from opm.io.ecl_state import EclipseState from opm.io.schedule import Schedule -from utils import test_path +try: + from tests.utils import test_path +except ImportError: + from utils import test_path def flowing(connection): - return connection.state == 'OPEN' + return connection.state == 'OPEN' def closed(connection): - return connection.state == 'SHUT' + return connection.state == 'SHUT' class TestWells(unittest.TestCase): diff --git a/python/tests/test_parse.py b/python/tests/test_parse.py index 80fc411ab..2cd5e1024 100644 --- a/python/tests/test_parse.py +++ b/python/tests/test_parse.py @@ -5,7 +5,10 @@ import sys from opm.io.parser import Parser, ParseContext from opm.io.ecl_state import EclipseState -from utils import test_path +try: + from tests.utils import test_path +except ImportError: + from utils import test_path class TestParse(unittest.TestCase): diff --git a/python/tests/test_parser.py b/python/tests/test_parser.py index f00283d53..efaf16d89 100644 --- a/python/tests/test_parser.py +++ b/python/tests/test_parser.py @@ -7,7 +7,11 @@ import numpy as np from opm.io.parser import Parser from opm.io.parser import ParseContext from opm.io.deck import DeckKeyword -from utils import test_path +try: + from tests.utils import test_path +except ImportError: + from utils import test_path + unit_foot = 0.3048 #meters diff --git a/python/tests/test_props.py b/python/tests/test_props.py index bd8fa53c8..d130068a8 100644 --- a/python/tests/test_props.py +++ b/python/tests/test_props.py @@ -3,7 +3,10 @@ import opm.io from opm.io.parser import Parser from opm.io.ecl_state import EclipseState -from utils import test_path +try: + from tests.utils import test_path +except ImportError: + from utils import test_path class TestProps(unittest.TestCase): diff --git a/python/tests/test_schedule.py b/python/tests/test_schedule.py index eea1335c1..a688dced4 100644 --- a/python/tests/test_schedule.py +++ b/python/tests/test_schedule.py @@ -4,8 +4,11 @@ import datetime as dt from opm.io.parser import Parser from opm.io.ecl_state import EclipseState from opm.io.schedule import Schedule -from utils import test_path +try: + from tests.utils import test_path +except ImportError: + from utils import test_path class TestSchedule(unittest.TestCase): diff --git a/python/tests/test_state.py b/python/tests/test_state.py index edcad6dff..13d521121 100644 --- a/python/tests/test_state.py +++ b/python/tests/test_state.py @@ -5,8 +5,10 @@ from opm.io.parser import Parser from opm.io.ecl_state import EclipseState from opm.io.schedule import Schedule from opm.io.summary import SummaryConfig -from utils import test_path - +try: + from tests.utils import test_path +except ImportError: + from utils import test_path class TestState2(unittest.TestCase): @@ -140,7 +142,7 @@ SATNUM # jf["GAS_OIL"] = -1.0 # N/A parser = Parser() - deck = parser.parse('tests/data/JFUNC.DATA') + deck = parser.parse(test_path('data/JFUNC.DATA')) js = EclipseState(deck) self.assertEqual('JFUNC TEST', js.title) jf = js.jfunc() diff --git a/python/tests/test_time_vector.py b/python/tests/test_time_vector.py index 9a51a01fe..d3986b1a7 100644 --- a/python/tests/test_time_vector.py +++ b/python/tests/test_time_vector.py @@ -3,7 +3,10 @@ import datetime from opm.tools import * from opm.io.parser import Parser -from utils import test_path, tmp +try: + from tests.utils import test_path, tmp +except ImportError: + from utils import test_path, tmp class TestTimeVector(unittest.TestCase): diff --git a/python/tests/test_wells.py b/python/tests/test_wells.py index c816cb6d1..d9fa3e1d1 100644 --- a/python/tests/test_wells.py +++ b/python/tests/test_wells.py @@ -3,7 +3,11 @@ import opm from opm.io.parser import Parser from opm.io.ecl_state import EclipseState from opm.io.schedule import Schedule -from utils import test_path + +try: + from tests.utils import test_path +except ImportError: + from utils import test_path def injector(well): return well.isinjector()