@pytest.mark.parametrize(argnames=['sensor'], argvalues=[[lazy_fixture('pressure_sensor')], [lazy_fixture('capacitive_sensor')], [lazy_fixture('temperature_sensor')], [lazy_fixture('humidity_sensor')]])
async def test_receive_data_read(sensor: sensor_abc.AbstractAdvancedSensor, mock_messenger: mock.AsyncMock, can_message_notifier: MockCanMessageNotifier) -> None:
    'Test that data is received from the read function.'

    def responder(node_id: NodeId, message: MessageDefinition) -> None:
        'Message responder.'
        can_message_notifier.notify(ReadFromSensorResponse(payload=ReadFromSensorResponsePayload(sensor_data=Int32Field(256), sensor_id=SensorIdField(SensorId.S0), sensor=SensorTypeField(sensor._sensor_type))), ArbitrationId(parts=ArbitrationIdParts(message_id=ReadFromSensorResponse.message_id, node_id=NodeId.host, function_code=0, originating_node_id=node_id)))
    mock_messenger.send.side_effect = responder
    return_data = (await sensor.read(mock_messenger, NodeId.pipette_left, False, 10))
    assert (return_data == SensorDataType.build([0, 1, 0]))
Test that data is received from the read function.
@pytest.mark.parametrize(argnames=['sensor'], argvalues=[[lazy_fixture('pressure_sensor')], [lazy_fixture('capacitive_sensor')], [lazy_fixture('temperature_sensor')], [lazy_fixture('humidity_sensor')]])
async def test_receive_data_read(sensor: sensor_abc.AbstractAdvancedSensor, mock_messenger: mock.AsyncMock, can_message_notifier: MockCanMessageNotifier) -> None:
    

    def responder(node_id: NodeId, message: MessageDefinition) -> None:
        'Message responder.'
        can_message_notifier.notify(ReadFromSensorResponse(payload=ReadFromSensorResponsePayload(sensor_data=Int32Field(256), sensor_id=SensorIdField(SensorId.S0), sensor=SensorTypeField(sensor._sensor_type))), ArbitrationId(parts=ArbitrationIdParts(message_id=ReadFromSensorResponse.message_id, node_id=NodeId.host, function_code=0, originating_node_id=node_id)))
    mock_messenger.send.side_effect = responder
    return_data = (await sensor.read(mock_messenger, NodeId.pipette_left, False, 10))
    assert (return_data == SensorDataType.build([0, 1, 0]))