예제 #1
0
 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")
예제 #2
0
 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))