Exemplo n.º 1
0
 def test_int_symmetry(self):
     """encode/decode_int should work back and forth."""
     result = wire.encode_int(99)
     self.assertEqual(wire.decode_int(result), (99, ''))
Exemplo n.º 2
0
def _extract_int(data, length=1):
    """Extract an n-byte integer, return it and the remaining string."""
    return wire.decode_int(data, length)