@pytest.mark.parametrize(argnames=['sensor', 'node_id', 'timeout'], argvalues=[[lazy_fixture('capacitive_sensor'), NodeId.pipette_right, 10], [lazy_fixture('pressure_sensor'), NodeId.pipette_left, 2]])
async def test_get_baseline(mock_messenger: mock.AsyncMock, can_message_notifier: MockCanMessageNotifier, sensor: sensor_abc.AbstractAdvancedSensor, node_id: NodeId, timeout: int) -> None:
    'Test for get_baseline.\n\n    Tests that a BaselineSensorRequest gets sent,\n    and reads ReadFromSensorResponse message containing the\n    correct information.\n    '

    def responder(node_id: NodeId, message: MessageDefinition) -> None:
        'Message responder.'
        if isinstance(message, BaselineSensorRequest):
            can_message_notifier.notify(ReadFromSensorResponse(payload=ReadFromSensorResponsePayload(sensor=SensorTypeField(sensor._sensor_type), sensor_id=SensorIdField(SensorId.S0), sensor_data=Int32Field(50))), ArbitrationId(parts=ArbitrationIdParts(message_id=ReadFromSensorResponse.message_id, node_id=node_id, function_code=0, originating_node_id=node_id)))
    mock_messenger.send.side_effect = responder
    baseline = (await sensor.get_baseline(mock_messenger, node_id, 100, timeout))
    assert (baseline == SensorDataType.build(Int32Field(50)))
Test for get_baseline.

Tests that a BaselineSensorRequest gets sent,
and reads ReadFromSensorResponse message containing the
correct information.
@pytest.mark.parametrize(argnames=['sensor', 'node_id', 'timeout'], argvalues=[[lazy_fixture('capacitive_sensor'), NodeId.pipette_right, 10], [lazy_fixture('pressure_sensor'), NodeId.pipette_left, 2]])
async def test_get_baseline(mock_messenger: mock.AsyncMock, can_message_notifier: MockCanMessageNotifier, sensor: sensor_abc.AbstractAdvancedSensor, node_id: NodeId, timeout: int) -> None:
    'Test for get_baseline.\n\n    Tests that a BaselineSensorRequest gets sent,\n    and reads ReadFromSensorResponse message containing the\n    correct information.\n    '

    def responder(node_id: NodeId, message: MessageDefinition) -> None:
        'Message responder.'
        if isinstance(message, BaselineSensorRequest):
            can_message_notifier.notify(ReadFromSensorResponse(payload=ReadFromSensorResponsePayload(sensor=SensorTypeField(sensor._sensor_type), sensor_id=SensorIdField(SensorId.S0), sensor_data=Int32Field(50))), ArbitrationId(parts=ArbitrationIdParts(message_id=ReadFromSensorResponse.message_id, node_id=node_id, function_code=0, originating_node_id=node_id)))
    mock_messenger.send.side_effect = responder
    baseline = (await sensor.get_baseline(mock_messenger, node_id, 100, timeout))
    assert (baseline == SensorDataType.build(Int32Field(50)))