@pytest.mark.parametrize(argnames=['sensor', 'node', 'message'], argvalues=[[lazy_fixture('pressure_sensor'), NodeId.pipette_left, ReadFromSensorRequest(payload=ReadFromSensorRequestPayload(sensor=SensorTypeField(SensorType.pressure), sensor_id=SensorIdField(SensorId.S0), offset_reading=UInt8Field(False)))], [lazy_fixture('capacitive_sensor'), NodeId.pipette_left, ReadFromSensorRequest(payload=ReadFromSensorRequestPayload(sensor=SensorTypeField(SensorType.capacitive), sensor_id=SensorIdField(SensorId.S0), offset_reading=UInt8Field(False)))], [lazy_fixture('temperature_sensor'), NodeId.pipette_left, ReadFromSensorRequest(payload=ReadFromSensorRequestPayload(sensor=SensorTypeField(SensorType.temperature), sensor_id=SensorIdField(SensorId.S0), offset_reading=UInt8Field(False)))], [lazy_fixture('humidity_sensor'), NodeId.pipette_left, ReadFromSensorRequest(payload=ReadFromSensorRequestPayload(sensor=SensorTypeField(SensorType.humidity), sensor_id=SensorIdField(SensorId.S0), offset_reading=UInt8Field(False)))]])
async def test_read(sensor: sensor_abc.AbstractAdvancedSensor, node: NodeId, message: MessageDefinition) -> None:
    'Test that a read function sends the expected message.'
    messenger = mock.AsyncMock(spec=CanMessenger)
    (await sensor.read(messenger, node, False))
    messenger.send.assert_called_once_with(node_id=node, message=message)
Test that a read function sends the expected message.
@pytest.mark.parametrize(argnames=['sensor', 'node', 'message'], argvalues=[[lazy_fixture('pressure_sensor'), NodeId.pipette_left, ReadFromSensorRequest(payload=ReadFromSensorRequestPayload(sensor=SensorTypeField(SensorType.pressure), sensor_id=SensorIdField(SensorId.S0), offset_reading=UInt8Field(False)))], [lazy_fixture('capacitive_sensor'), NodeId.pipette_left, ReadFromSensorRequest(payload=ReadFromSensorRequestPayload(sensor=SensorTypeField(SensorType.capacitive), sensor_id=SensorIdField(SensorId.S0), offset_reading=UInt8Field(False)))], [lazy_fixture('temperature_sensor'), NodeId.pipette_left, ReadFromSensorRequest(payload=ReadFromSensorRequestPayload(sensor=SensorTypeField(SensorType.temperature), sensor_id=SensorIdField(SensorId.S0), offset_reading=UInt8Field(False)))], [lazy_fixture('humidity_sensor'), NodeId.pipette_left, ReadFromSensorRequest(payload=ReadFromSensorRequestPayload(sensor=SensorTypeField(SensorType.humidity), sensor_id=SensorIdField(SensorId.S0), offset_reading=UInt8Field(False)))]])
async def test_read(sensor: sensor_abc.AbstractAdvancedSensor, node: NodeId, message: MessageDefinition) -> None:
    
    messenger = mock.AsyncMock(spec=CanMessenger)
    (await sensor.read(messenger, node, False))
    messenger.send.assert_called_once_with(node_id=node, message=message)