Skip to content

Commit 202734b

Browse files
committed
Update EV Charger StatusTracker tests to send mock data by itself
This allows us to remove the last usage of the automatic streaming tasks provided by the MockMicrogrid from the SDK tests. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 0316963 commit 202734b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/timeseries/test_ev_charger_pool.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ async def test_state_updates(self, mocker: MockerFixture) -> None:
3232
grid_side_meter=False, api_client_streaming=True, sample_rate_s=0.01
3333
)
3434
mockgrid.add_ev_chargers(5)
35-
mockgrid.start_mock_client(lambda client: client.initialize(mocker))
35+
await mockgrid.start(mocker)
3636

3737
state_tracker = StateTracker(set(mockgrid.evc_ids))
38+
await asyncio.sleep(0.05)
3839

3940
async def check_states(
4041
expected: dict[int, EVChargerState],
4142
) -> None:
43+
await mockgrid.send_ev_charger_data(
44+
[0.0] * 5 # for testing status updates, the values don't matter.
45+
)
4246
await asyncio.sleep(0.05)
4347
for comp_id, exp_state in expected.items():
4448
assert state_tracker.get(comp_id) == exp_state

0 commit comments

Comments
 (0)