def test_to_knx_error(self): """Test to_knx function with wrong parametern.""" xknx = XKNX() remote_value = RemoteValueTemp(xknx) with pytest.raises(ConversionError): remote_value.to_knx(-300) with pytest.raises(ConversionError): remote_value.to_knx("abc")
def test_to_knx(self): """Test to_knx function with normal operation.""" xknx = XKNX() remote_value = RemoteValueTemp(xknx) assert remote_value.to_knx(11) == DPTArray((0x04, 0x4C))