示例#1
0
 def testBitFieldMultiByteEncoderSignedUnsupported(self):
     with self.assertRaises(KittyException):
         BitField(-12,
                  length=8,
                  signed=True,
                  max_value=127,
                  encoder=BitFieldMultiByteEncoder())
示例#2
0
 def testUnsignedLength8(self):
     bitfield = BitField(0xaa,
                         length=8,
                         signed=False,
                         max_value=255,
                         encoder=BitFieldMultiByteEncoder())
     self._test(bitfield)
示例#3
0
 def testUnsignedLength16(self):
     bitfield = BitField(1234,
                         length=16,
                         signed=False,
                         encoder=BitFieldMultiByteEncoder())
     self._test(bitfield)
示例#4
0
 def testUnsignedLength64(self):
     bitfield = BitField(78945,
                         length=64,
                         signed=False,
                         encoder=BitFieldMultiByteEncoder())
     self._test(bitfield)