def test_pull_uint8_truncated(self): buf = Buffer(capacity=0) with self.assertRaises(BufferReadError): buf.pull_uint8() self.assertEqual(buf.tell(), 0)
def test_pull_uint8(self): buf = Buffer(data=b"\x08\x07\x06\x05\x04\x03\x02\x01") self.assertEqual(buf.pull_uint8(), 0x08) self.assertEqual(buf.tell(), 1)