예제 #1
0
def test_initialize_from_file_like():
    from io import BytesIO

    config = BytesIO(yaml.dump(config_val, encoding=("utf-8")))
    model = Sampling()
    model.initialize(config)
    assert_true(os.path.exists(dakota_files["input"]))
예제 #2
0
def test_update():
    if is_dakota_installed():
        model = Sampling()
        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"]))
예제 #3
0
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 = Sampling()
    model.initialize(fname)
    os.remove(fname)
    assert_true(os.path.exists(dakota_files["input"]))
예제 #4
0
def test_initialize_defaults():
    model = Sampling()
    model.initialize()
    assert_true(os.path.exists(dakota_files["input"]))
예제 #5
0
def test_end_time():
    model = Sampling()
    model.initialize()
    assert_equal(model.get_end_time(), 1.0)
예제 #6
0
def test_start_time():
    model = Sampling()
    model.initialize()
    assert_equal(model.get_start_time(), 0.0)
예제 #7
0
def test_finalize():
    if is_dakota_installed():
        model = Sampling()
        model.initialize()
        model.update()
        model.finalize()