def test_failed_run_OK(self): self.init_eclrun_config() shutil.copy( os.path.join(self.SOURCE_ROOT, "test-data/local/eclipse/SPE1_ERROR.DATA"), "SPE1_ERROR.DATA", ) ecl_config = Ecl100Config() run(ecl_config, ["SPE1_ERROR", "--version=2019.3", "--ignore-errors"])
def test_mpi_run(self): self.init_ecl100_config() shutil.copy( os.path.join(self.TESTDATA_ROOT, "local/eclipse/SPE1_PARALLELL.DATA"), "SPE1_PARALLELL.DATA", ) ecl_config = Ecl100Config() run(ecl_config, ["SPE1_PARALLELL.DATA", "--version=2014.2", "--num-cpu=2"]) self.assertTrue(os.path.isfile("SPE1_PARALLELL.LOG")) self.assertTrue(os.path.getsize("SPE1_PARALLELL.LOG") > 0)
def test_run_api(self): self.init_ecl100_config() shutil.copy( os.path.join(self.TESTDATA_ROOT, "local/eclipse/SPE1.DATA"), "SPE1.DATA", ) ecl_config = Ecl100Config() run(ecl_config, ["SPE1.DATA", "--version=2014.2"]) self.assertTrue(os.path.isfile("SPE1.DATA"))
def test_run_api(self): self.init_eclrun_config() shutil.copy( os.path.join(self.SOURCE_ROOT, "test-data/local/eclipse/SPE1.DATA"), "SPE1.DATA", ) ecl_config = Ecl100Config() run(ecl_config, ["SPE1.DATA", "--version=2019.3"]) self.assertTrue(os.path.isfile("SPE1.DATA"))
def test_flag_to_produce_hdf5_output_with_ecl100(self): self.init_eclrun_config() shutil.copy( os.path.join(self.TESTDATA_ROOT, "local/eclipse/SPE1.DATA"), "SPE1.DATA", ) ecl_config = Ecl100Config() # check that with flag .h5 file IS produced run(ecl_config, ["SPE1.DATA", "--version=2019.3", "--summary-conversion"]) self.assertTrue(os.path.exists("SPE1.h5"))
def test_no_hdf5_output_by_default_with_ecl100(self): self.init_eclrun_config() shutil.copy( os.path.join(self.TESTDATA_ROOT, "local/eclipse/SPE1.DATA"), "SPE1.DATA", ) ecl_config = Ecl100Config() # check that by default .h5 file IS NOT produced run(ecl_config, ["SPE1.DATA", "--version=2019.3"]) self.assertFalse(os.path.exists("SPE1.h5"))
def test_failed_run_OK(self): self.init_ecl100_config() shutil.copy( os.path.join(self.TESTDATA_ROOT, "local/eclipse/SPE1_ERROR.DATA"), "SPE1_ERROR.DATA", ) ecl_config = Ecl100Config() run(ecl_config, ["SPE1_ERROR", "--version=2014.2", "--ignore-errors"]) # Monkey patching the ecl_run to use an executable which will fail with exit(1), # in the nocheck mode that should also be OK. sim = ecl_config.sim("2014.2") ecl_run = EclRun("SPE1_ERROR", sim, check_status=False) ecl_run.sim.executable = os.path.join( self.SOURCE_ROOT, "tests/libres_tests/res/fm/ecl_run_fail" ) ecl_run.runEclipse()
def test_flow(self): self.init_flow_config() shutil.copy( os.path.join(self.TESTDATA_ROOT, "local/eclipse/SPE1.DATA"), "SPE1.DATA", ) shutil.copy( os.path.join(self.TESTDATA_ROOT, "local/eclipse/SPE1_ERROR.DATA"), "SPE1_ERROR.DATA", ) flow_config = FlowConfig() sim = flow_config.sim() flow_run = EclRun("SPE1.DATA", sim) flow_run.runEclipse() run(flow_config, ["SPE1.DATA"]) flow_run = EclRun("SPE1_ERROR.DATA", sim) with self.assertRaises(Exception): flow_run.runEclipse() run(flow_config, ["SPE1_ERROR.DATA", "--ignore-errors"]) # Invalid version with self.assertRaises(Exception): run(flow_config, ["SPE1.DATA", "--version=no/such/version"])