@@ -158,7 +158,7 @@ async def setup_all_batteries(mocker: MockerFixture) -> AsyncIterator[SetupArgs]
158158 # the scope of this tests. This tests should cover BatteryPool only.
159159 # We use our own battery status channel, where we easily control set of working
160160 # batteries.
161- battery_pool = microgrid .battery_pool ()
161+ battery_pool = microgrid .battery_pool (priority = 5 )
162162
163163 dp = microgrid ._data_pipeline ._DATA_PIPELINE
164164 assert dp is not None
@@ -212,7 +212,9 @@ async def setup_batteries_pool(mocker: MockerFixture) -> AsyncIterator[SetupArgs
212212 # batteries.
213213 all_batteries = list (get_components (mock_microgrid , ComponentCategory .BATTERY ))
214214
215- battery_pool = microgrid .battery_pool (set (all_batteries [:2 ]))
215+ battery_pool = microgrid .battery_pool (
216+ priority = 5 , component_ids = set (all_batteries [:2 ])
217+ )
216218
217219 dp = microgrid ._data_pipeline ._DATA_PIPELINE
218220 assert dp is not None
@@ -548,7 +550,7 @@ async def test_batter_pool_power_no_batteries(mocker: MockerFixture) -> None:
548550 )
549551 )
550552 await mockgrid .start (mocker )
551- battery_pool = microgrid .battery_pool ()
553+ battery_pool = microgrid .battery_pool (priority = 5 )
552554 power_receiver = battery_pool .power .new_receiver ()
553555
554556 await mockgrid .mock_resampler .send_non_existing_component_value ()
@@ -565,7 +567,7 @@ async def test_battery_pool_power_with_no_inverters(mocker: MockerFixture) -> No
565567 await mockgrid .start (mocker )
566568
567569 with pytest .raises (RuntimeError ):
568- microgrid .battery_pool ()
570+ microgrid .battery_pool (priority = 5 )
569571
570572
571573async def test_battery_pool_power_incomplete_bat_request (mocker : MockerFixture ) -> None :
@@ -588,7 +590,7 @@ async def test_battery_pool_power_incomplete_bat_request(mocker: MockerFixture)
588590 with pytest .raises (FormulaGenerationError ):
589591 # Request only two of the three batteries behind the inverters
590592 battery_pool = microgrid .battery_pool (
591- component_ids = set ([bats [1 ].component_id , bats [0 ].component_id ])
593+ priority = 5 , component_ids = set ([bats [1 ].component_id , bats [0 ].component_id ])
592594 )
593595 power_receiver = battery_pool .power .new_receiver ()
594596 await mockgrid .mock_resampler .send_bat_inverter_power ([2.0 ])
@@ -597,7 +599,7 @@ async def test_battery_pool_power_incomplete_bat_request(mocker: MockerFixture)
597599
598600async def _test_battery_pool_power (mockgrid : MockMicrogrid ) -> None :
599601 async with mockgrid :
600- battery_pool = microgrid .battery_pool ()
602+ battery_pool = microgrid .battery_pool (priority = 5 )
601603 power_receiver = battery_pool .power .new_receiver ()
602604
603605 await mockgrid .mock_resampler .send_bat_inverter_power ([2.0 , 3.0 ])
0 commit comments