

@mock_kernel_modules
def test_unsupported_unit_error(self):
    unsupported_unit = 255
    sensor_id = create_w1_therm_sensor(W1ThermSensor.THERM_SENSOR_DS1822)
    sensor = W1ThermSensor(W1ThermSensor.THERM_SENSOR_DS1822, sensor_id)
    sensor.get_temperature.when.called_with(unsupported_unit).should.throw(UnsupportedUnitError, 'Only Degrees C, F and Kelvin are currently supported')

dataset/ETHPy150Open timofurrer/w1thermsensor/test/test_core.py W1ThermSensorTest.test_unsupported_unit_error/original