@pytest.mark.parametrize(argnames=['sensor', 'node', 'message'], argvalues=[[lazy_fixture('pressure_sensor'), NodeId.pipette_left, BaselineSensorRequest(payload=BaselineSensorRequestPayload(sensor=SensorTypeField(SensorType.pressure), sensor_id=SensorIdField(SensorId.S0), sample_rate=UInt16Field(10)))], [lazy_fixture('capacitive_sensor'), NodeId.pipette_left, BaselineSensorRequest(payload=BaselineSensorRequestPayload(sensor=SensorTypeField(SensorType.capacitive), sensor_id=SensorIdField(SensorId.S0), sample_rate=UInt16Field(10)))]])
async def test_polling(sensor: sensor_abc.AbstractAdvancedSensor, node: NodeId, message: MessageDefinition) -> None:
    'Test that a polling function sends the expected message.'
    messenger = mock.AsyncMock(spec=CanMessenger)
    (await sensor.get_baseline(messenger, node, 10, 10))
    messenger.send.assert_called_once_with(node_id=node, message=message)
Test that a polling function sends the expected message.
@pytest.mark.parametrize(argnames=['sensor', 'node', 'message'], argvalues=[[lazy_fixture('pressure_sensor'), NodeId.pipette_left, BaselineSensorRequest(payload=BaselineSensorRequestPayload(sensor=SensorTypeField(SensorType.pressure), sensor_id=SensorIdField(SensorId.S0), sample_rate=UInt16Field(10)))], [lazy_fixture('capacitive_sensor'), NodeId.pipette_left, BaselineSensorRequest(payload=BaselineSensorRequestPayload(sensor=SensorTypeField(SensorType.capacitive), sensor_id=SensorIdField(SensorId.S0), sample_rate=UInt16Field(10)))]])
async def test_polling(sensor: sensor_abc.AbstractAdvancedSensor, node: NodeId, message: MessageDefinition) -> None:
    
    messenger = mock.AsyncMock(spec=CanMessenger)
    (await sensor.get_baseline(messenger, node, 10, 10))
    messenger.send.assert_called_once_with(node_id=node, message=message)