예제 #1
0
def test_failure_too_many_hours():
    with pytest.raises(ValueError):
        calculate_net_load_peak(scenario, ["solar"], hours=100)
예제 #2
0
def test_failure_one_resource_not_present():
    with pytest.raises(ValueError):
        calculate_net_load_peak(scenario, ["wind", "geothermal"], 10)
예제 #3
0
def test_failure_no_resources():
    with pytest.raises(ValueError):
        calculate_net_load_peak(scenario, [], 10)
예제 #4
0
def test_failure_hours_type():
    with pytest.raises(TypeError):
        calculate_net_load_peak(scenario, ["solar", "wind"], hours=10.0)
예제 #5
0
def test_failure_no_resources_present():
    with pytest.raises(ValueError):
        calculate_net_load_peak(scenario, ["geothermal"], hours=10)
예제 #6
0
def test_calculate_net_load_peak_solar_wind_5():
    capacity_value = calculate_net_load_peak(scenario, {"solar", "wind"}, 5)
    assert capacity_value == approx(7397.2)
예제 #7
0
def test_failure_resources_type_dict():
    with pytest.raises(TypeError):
        calculate_net_load_peak(scenario, {"solar": "wind"}, hours=10)
예제 #8
0
def test_calculate_net_load_peak_solar_wind():
    capacity_value = calculate_net_load_peak(scenario, {"solar", "wind"}, 10)
    assert capacity_value == approx(8211.5)
예제 #9
0
def test_calculate_net_load_peak_wind_5():
    assert calculate_net_load_peak(scenario, {"wind"}, 5) == approx(3017.4)
예제 #10
0
def test_calculate_net_load_peak_wind():
    assert calculate_net_load_peak(scenario, {"wind"}, 10) == approx(3370.8)
예제 #11
0
def test_calculate_net_load_peak_solar_5():
    assert calculate_net_load_peak(scenario, {"solar"}, 5) == approx(2088.6)
예제 #12
0
def test_calculate_net_load_peak_solar():
    assert calculate_net_load_peak(scenario, {"solar"}, 10) == approx(2535.2)