from res.enkf import ResConfig, SiteConfig, AnalysisConfig # The res_config object should set the environment variable # 'DATA_ROOT' to the root directory with the config # file. Unfortunately the python methods to get environment variable, # os.getenv() and os.environ[] do not reflect the: # # setenv( "DATA_ROOT" , ...) # # call in the res_config C code. We therefor create a wrapper to the # underlying libc getenv() function to be used for testing. from cwrap import Prototype from cwrap import load clib = load( None ) clib_getenv = Prototype(clib, "char* getenv( char* )" , bind = False) config_defines = { "<USER>" : "TEST_USER", "<SCRATCH>" : "scratch/ert", "<CASE_DIR>" : "the_extensive_case", "<ECLIPSE_NAME>" : "XYZ" } config_data = { "RUNPATH" : "<SCRATCH>/<USER>/<CASE_DIR>/realization-%d/iter-%d", "NUM_REALIZATIONS" : 10, "MAX_RUNTIME" : 23400, "MIN_REALIZATIONS" : "50%",
class TestUtilPrototype(Prototype): lib = load("msvcrt" if os.name == "nt" else None) def __init__(self, prototype, bind=False): super(TestUtilPrototype, self).__init__(TestUtilPrototype.lib, prototype, bind=bind)
class _NonePrototype(cwrap.Prototype): lib = cwrap.load(None) def __init__(self, prototype, bind=True): super().__init__(_NonePrototype.lib, prototype, bind=bind)
class TestPrototype(Prototype): lib = load("msvcrt" if os.name == "nt" else None) def __init__(self, prototype): super(TestPrototype, self).__init__(self.lib, prototype)
class TestPrototype(Prototype): lib = load(None) def __init__(self, prototype): super(TestPrototype, self).__init__(self.lib, prototype)
class TestPrototype(Prototype): lib = load("libert_util") def __init__(self, prototype): super(TestPrototype, self).__init__(self.lib, prototype)