Example #1
0
def test_first_market_cycle_with_initial_capacity(storage_strategy_test8: StorageStrategy,
                                                  area_test8: FakeArea):
    storage_strategy_test8.event_activate()
    storage_strategy_test8.event_market_cycle()
    sell_market = area_test8.all_markets[0]
    assert(isclose(storage_strategy_test8.state.offered_sell_kWh[sell_market.time_slot],
                   100.0 - storage_strategy_test8.state.capacity *
                   storage_strategy_test8.state.min_allowed_soc_ratio, rel_tol=1e-02))
    assert len(storage_strategy_test8.offers.posted_in_market(
        area_test8._markets_return["Fake Market"].id)
    ) > 0
Example #2
0
def test_first_market_cycle_with_initial_capacity(
        storage_strategy_test8: StorageStrategy, area_test8: FakeArea):
    storage_strategy_test8.event_activate()
    storage_strategy_test8.event_market_cycle()
    sell_market = area_test8.all_markets[0]
    assert storage_strategy_test8.state.offered_sell_kWh[sell_market.time_slot] == \
        100.0 - storage_strategy_test8.state.capacity * \
        ConstSettings.StorageSettings.MIN_ALLOWED_SOC
    assert len(
        storage_strategy_test8.offers.posted_in_market(
            area_test8._markets_return["Fake Market"])) > 0