Skip to content

Commit 9dd7085

Browse files
committed
Accept all ComponentData types when attempting to send mock data
This is fine because there are runtime checks to identify message type, in the `send` method. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 295b668 commit 9dd7085

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/utils/mock_microgrid.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"""Mock microgrid definition."""
55
from functools import partial
6-
from typing import Any, Dict, Set, Union
6+
from typing import Any, Dict, Set
77
from unittest.mock import AsyncMock, MagicMock
88

99
from frequenz.channels import Broadcast, Receiver
@@ -17,6 +17,7 @@
1717
BatteryData,
1818
Component,
1919
ComponentCategory,
20+
ComponentData,
2021
InverterData,
2122
)
2223

@@ -89,7 +90,7 @@ def component_graph(self) -> ComponentGraph:
8990
"""
9091
return self._component_graph
9192

92-
async def send(self, data: Union[BatteryData, InverterData]) -> bool:
93+
async def send(self, data: ComponentData) -> bool:
9394
"""Send component data using channel.
9495
9596
This simulates component sending data. Right now only battery and inverter

0 commit comments

Comments
 (0)