def test_0x10000000(self): data = BytesIO(b"\xF0\x10\x00\x00\x00") self.assertEqual(0x10000000, base_api.decode_length(data.read))
def test_over_0x80(self): data = BytesIO(b"\x81\x2c") self.assertEqual(300, base_api.decode_length(data.read))
def test_over_0x3FFF(self): data = BytesIO(b"\xc0\x42\x68") self.assertEqual(17000, base_api.decode_length(data.read))
def test_zero(self): data = BytesIO(b"\x00") self.assertEqual(0, base_api.decode_length(data.read))