def test_initialize_from_file_like(): from io import BytesIO config = BytesIO(yaml.dump(config_val, encoding=("utf-8"))) model = MultidimParameterStudy() model.initialize(config) assert_true(os.path.exists(dakota_files["input"]))
def test_initialize_from_file(): import tempfile with tempfile.NamedTemporaryFile("w", delete=False) as fp: fp.write(yaml.dump(config_val)) fname = fp.name model = MultidimParameterStudy() model.initialize(fname) os.remove(fname) assert_true(os.path.exists(dakota_files["input"]))
def test_update(): if is_dakota_installed(): model = MultidimParameterStudy() model.initialize() model.update() assert_true(os.path.exists(dakota_files["input"])) assert_true(os.path.exists(dakota_files["output"])) assert_true(os.path.exists(dakota_files["data"]))
def test_finalize(): if is_dakota_installed(): model = MultidimParameterStudy() model.initialize() model.update() model.finalize()
def test_initialize_defaults(): model = MultidimParameterStudy() model.initialize() assert_true(os.path.exists(dakota_files["input"]))
def test_time_step(): model = MultidimParameterStudy() assert_equal(model.get_time_step(), 1.0)
def test_current_time(): model = MultidimParameterStudy() assert_equal(model.get_current_time(), 0.0)
def test_end_time(): model = MultidimParameterStudy() model.initialize() assert_equal(model.get_end_time(), 1.0)
def test_component_name(): model = MultidimParameterStudy() name = model.get_component_name() assert_equal(name, "MultidimParameterStudy") assert_is(model.get_component_name(), name)