def test_run_from_config_file(): """Test running a HydroTrend simulation from a config file.""" d = Dakota.from_file_like(known_config_file) d.run_directory = run_dir d.template_file = os.path.join(data_dir, "HYDRO.IN.dtmpl") d.auxiliary_files = os.path.join(data_dir, "HYDRO0.HYPS") d.serialize(config_file) d.write_input_file() assert_true(os.path.exists(d.input_file)) if is_dakota_installed() and is_hydrotrend_installed(): d.run() assert_true(os.path.exists(d.output_file))
def test_init_from_file_like1(): """Test creating an instance from a config file.""" k = Dakota.from_file_like(known_config_file) assert_is_instance(k, Dakota)
def test_init_from_file_like2(): """Test creating an instance from an open config file object.""" with open(known_config_file, "r") as fp: k = Dakota.from_file_like(fp) assert_is_instance(k, Dakota)
def setup(): """Called at start of any test using it @with_setup()""" global d d = Dakota.from_file_like(config_file)