Skip to content

Commit dbf46b9

Browse files
committed
Improve sensor streaming test to test metric filtering
The test was requesting only one metric, but also sensing only one metric, so the filtering wasn't being tested. We also rename the test to make it more specific. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent ec02eeb commit dbf46b9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ async def test_set_bounds_grpc_error(client: _TestClient) -> None:
912912
await client.set_bounds(ComponentId(99), 0.0, 100.0)
913913

914914

915-
async def test_stream_sensor_data_success(
915+
async def test_stream_sensor_data_one_metric(
916916
sensor201: microgrid_pb2.Component, client: _TestClient
917917
) -> None:
918918
"""Test successful streaming of sensor data."""
@@ -933,7 +933,11 @@ async def stream_data_impl(
933933
sensor_pb2.SensorData(
934934
value=1.0,
935935
sensor_metric=sensor_pb2.SensorMetric.SENSOR_METRIC_TEMPERATURE,
936-
)
936+
),
937+
sensor_pb2.SensorData(
938+
value=2.0,
939+
sensor_metric=sensor_pb2.SensorMetric.SENSOR_METRIC_PRESSURE,
940+
),
937941
],
938942
),
939943
),

0 commit comments

Comments
 (0)