@pytest.mark.parametrize(argnames=['sensor', 'node', 'message'], argvalues=[[lazy_fixture('pressure_sensor'), NodeId.pipette_left, WriteToSensorRequest(payload=WriteToSensorRequestPayload(sensor=SensorTypeField(SensorType.pressure), sensor_id=SensorIdField(SensorId.S0), data=UInt32Field(SensorDataType.build([2, 2, 0, 0]).to_int), reg_address=UInt8Field(0)))], [lazy_fixture('capacitive_sensor'), NodeId.pipette_left, WriteToSensorRequest(payload=WriteToSensorRequestPayload(sensor=SensorTypeField(SensorType.capacitive), sensor_id=SensorIdField(SensorId.S0), data=UInt32Field(SensorDataType.build([2, 2, 0, 0]).to_int), reg_address=UInt8Field(0)))], [lazy_fixture('temperature_sensor'), NodeId.pipette_left, WriteToSensorRequest(payload=WriteToSensorRequestPayload(sensor=SensorTypeField(SensorType.temperature), sensor_id=SensorIdField(SensorId.S0), data=UInt32Field(SensorDataType.build([2, 2, 0, 0]).to_int), reg_address=UInt8Field(0)))], [lazy_fixture('humidity_sensor'), NodeId.pipette_left, WriteToSensorRequest(payload=WriteToSensorRequestPayload(sensor=SensorTypeField(SensorType.humidity), sensor_id=SensorIdField(SensorId.S0), data=UInt32Field(SensorDataType.build([2, 2, 0, 0]).to_int), reg_address=UInt8Field(0)))]])
async def test_write(sensor: sensor_abc.AbstractAdvancedSensor, node: NodeId, message: MessageDefinition) -> None:
    'Check that writing sensor data is successful.'
    data = SensorDataType.build([2, 2, 0, 0])
    messenger = mock.AsyncMock(spec=CanMessenger)
    (await sensor.write(messenger, NodeId.pipette_left, data))
    messenger.send.assert_called_once_with(node_id=node, message=message)
Check that writing sensor data is successful.
@pytest.mark.parametrize(argnames=['sensor', 'node', 'message'], argvalues=[[lazy_fixture('pressure_sensor'), NodeId.pipette_left, WriteToSensorRequest(payload=WriteToSensorRequestPayload(sensor=SensorTypeField(SensorType.pressure), sensor_id=SensorIdField(SensorId.S0), data=UInt32Field(SensorDataType.build([2, 2, 0, 0]).to_int), reg_address=UInt8Field(0)))], [lazy_fixture('capacitive_sensor'), NodeId.pipette_left, WriteToSensorRequest(payload=WriteToSensorRequestPayload(sensor=SensorTypeField(SensorType.capacitive), sensor_id=SensorIdField(SensorId.S0), data=UInt32Field(SensorDataType.build([2, 2, 0, 0]).to_int), reg_address=UInt8Field(0)))], [lazy_fixture('temperature_sensor'), NodeId.pipette_left, WriteToSensorRequest(payload=WriteToSensorRequestPayload(sensor=SensorTypeField(SensorType.temperature), sensor_id=SensorIdField(SensorId.S0), data=UInt32Field(SensorDataType.build([2, 2, 0, 0]).to_int), reg_address=UInt8Field(0)))], [lazy_fixture('humidity_sensor'), NodeId.pipette_left, WriteToSensorRequest(payload=WriteToSensorRequestPayload(sensor=SensorTypeField(SensorType.humidity), sensor_id=SensorIdField(SensorId.S0), data=UInt32Field(SensorDataType.build([2, 2, 0, 0]).to_int), reg_address=UInt8Field(0)))]])
async def test_write(sensor: sensor_abc.AbstractAdvancedSensor, node: NodeId, message: MessageDefinition) -> None:
    
    data = SensorDataType.build([2, 2, 0, 0])
    messenger = mock.AsyncMock(spec=CanMessenger)
    (await sensor.write(messenger, NodeId.pipette_left, data))
    messenger.send.assert_called_once_with(node_id=node, message=message)