Exemplo n.º 1
0
 def test_pull_uint64_truncated(self):
     buf = Buffer(capacity=7)
     with self.assertRaises(BufferReadError):
         buf.pull_uint64()
     self.assertEqual(buf.tell(), 0)
Exemplo n.º 2
0
 def test_pull_uint64(self):
     buf = Buffer(data=b"\x08\x07\x06\x05\x04\x03\x02\x01")
     self.assertEqual(buf.pull_uint64(), 0x0807060504030201)
     self.assertEqual(buf.tell(), 8)