示例#1
0
def test_phase_specific_file_extraction():

    project = ProjectManager(config)
    turbine_config = project.create_config_for_phase("TurbineInstallation")
    monopile_config = project.create_config_for_phase("MonopileInstallation")

    assert isinstance(turbine_config["wtiv"], dict)
    assert isinstance(monopile_config["wtiv"], dict)

    bad_config = deepcopy(config)
    _ = bad_config.pop("TurbineInstallation")
    bad_config["wtiv"] = "example_wtiv"
    bad_config["MonopileInstallation"]["wtiv"] = "missing_vessel"

    with pytest.raises(LibraryItemNotFoundError):
        bad_project = ProjectManager(bad_config)
示例#2
0
def test_phase_specific_definitions():
    """
    Tests that phase specific information makes it to phase_config.
    """

    project = ProjectManager(config)

    phase_config = project.create_config_for_phase("MonopileInstallation")

    assert phase_config["wtiv"]["name"] == "Phase Specific WTIV"
    assert phase_config["site"]["distance"] == 500

    phase_config = project.create_config_for_phase("TurbineInstallation")

    assert phase_config["wtiv"]["name"] == "Example WTIV"
    assert phase_config["site"]["distance"] == 50

    project.run()