예제 #1
0
def test_hourly_demand_summary():
    data = read_solar_data(p)
    demand = hourly_demand_summary(data)
    pprint(demand)
    assert type(demand) == dict, "output data type must be dict"
    assert (
        demand[datetime(2021, 2, 19, 12)] == 106537.0
    ), "power produced at 12PM on Feb. 19, 2021"
예제 #2
0
def test_weekly_summary():
    data = list(read_solar_data(p))
    demand = weekly_power_summary(data)
    pprint(demand)
    assert type(demand) == dict, "output data type must be dict"
    assert demand[datetime(2021, 2, 21)] == 2987365.0, "power produced on Feb. 6, 2021"
예제 #3
0
def test_max_average_power_produced():
    data = read_solar_data(p)
    demand = maximum_hourly_data(data)
    assert demand == datetime(2021, 2, 20, 11, 0)
예제 #4
0
def test_max_power_produced():
    data = read_solar_data(p)
    demand = max_average_power_produced(data)
    assert type(demand) == tuple
    assert type(demand[0]) == datetime
    assert type(demand[1]) == float
예제 #5
0
def test_daily_demand_summary():
    data = list(read_solar_data(p))
    demand = daily_demand_summary(data)
    pprint(demand)
    assert type(demand) == dict, "output data type must be dict"
    assert demand[datetime(2021, 2, 6)] == 72149.0, "power produced on Feb. 6, 2021"