Example #1
0
from res.job_queue import QueueDriverEnum
from res.sched import HistorySourceEnum
from res.util.enums import MessageLevelEnum

# 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 therefore create a wrapper to the
# underlying libc getenv() function to be used for testing.

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,