Skip to content

Commit 2652600

Browse files
committed
Fix last_id in fake service when setting dispatches
Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 9850141 commit 2652600

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/frequenz/client/dispatch/test/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ def set_dispatches(self, microgrid_id: int, value: list[Dispatch]) -> None:
5353
value: The list of dispatches to set.
5454
"""
5555
self._service.dispatches[microgrid_id] = value
56+
# Max between last id and the max id in the list
57+
self._service._last_id = max(
58+
self._service._last_id, max(dispatch.id for dispatch in value)
59+
)
5660

5761
@property
5862
def _service(self) -> FakeService:

0 commit comments

Comments
 (0)