示例#1
0
 def test_dib_base(self):
     raw = ((0x0c, 0x02, 0x02, 0x01, 0x03, 0x02, 0x04, 0x01, 0x05, 0x01,
             0x07, 0x01))
     dib = DIBGeneric()
     self.assertEqual(dib.from_knx(raw), 12)
     self.assertEqual(dib.dtc, DIBTypeCode.SUPP_SVC_FAMILIES)
     self.assertEqual(dib.to_knx(), list(raw))
     self.assertEqual(dib.calculated_length(), 12)
示例#2
0
 def test_dib_base(self):
     """Test parsing and streaming KNX/IP DIB packet."""
     raw = (0x0C, 0x02, 0x02, 0x01, 0x03, 0x02, 0x04, 0x01, 0x05, 0x01, 0x07, 0x01)
     dib = DIBGeneric()
     self.assertEqual(dib.from_knx(raw), 12)
     self.assertEqual(dib.dtc, DIBTypeCode.SUPP_SVC_FAMILIES)
     self.assertEqual(dib.to_knx(), list(raw))
     self.assertEqual(dib.calculated_length(), 12)
示例#3
0
 def test_dib_base(self):
     """Test parsing and streaming KNX/IP DIB packet."""
     raw = (0x0C, 0x02, 0x02, 0x01, 0x03, 0x02, 0x04, 0x01, 0x05, 0x01, 0x07, 0x01)
     dib = DIBGeneric()
     assert dib.from_knx(raw) == 12
     assert dib.dtc == DIBTypeCode.SUPP_SVC_FAMILIES
     assert dib.to_knx() == list(raw)
     assert dib.calculated_length() == 12
示例#4
0
文件: dib_test.py 项目: phbaer/xknx
 def test_dib_base(self):
     """Test parsing and streaming KNX/IP DIB packet."""
     raw = ((0x0c, 0x02, 0x02, 0x01, 0x03, 0x02, 0x04, 0x01,
             0x05, 0x01, 0x07, 0x01))
     dib = DIBGeneric()
     self.assertEqual(dib.from_knx(raw), 12)
     self.assertEqual(dib.dtc, DIBTypeCode.SUPP_SVC_FAMILIES)
     self.assertEqual(dib.to_knx(), list(raw))
     self.assertEqual(dib.calculated_length(), 12)