def test_read_bigsize_int(self):
    self.assertEqual(0, read_bigsize_int(io.BytesIO(bfh('00'))))
    self.assertEqual(252, read_bigsize_int(io.BytesIO(bfh('fc'))))
    self.assertEqual(253, read_bigsize_int(io.BytesIO(bfh('fd00fd'))))
    self.assertEqual(65535, read_bigsize_int(io.BytesIO(bfh('fdffff'))))
    self.assertEqual(65536, read_bigsize_int(io.BytesIO(bfh('fe00010000'))))
    self.assertEqual(4294967295, read_bigsize_int(io.BytesIO(bfh('feffffffff'))))
    self.assertEqual(4294967296, read_bigsize_int(io.BytesIO(bfh('ff0000000100000000'))))
    self.assertEqual(18446744073709551615, read_bigsize_int(io.BytesIO(bfh('ffffffffffffffffff'))))
    with self.assertRaises(FieldEncodingNotMinimal):
        read_bigsize_int(io.BytesIO(bfh('fd00fc')))
    with self.assertRaises(FieldEncodingNotMinimal):
        read_bigsize_int(io.BytesIO(bfh('fe0000ffff')))
    with self.assertRaises(FieldEncodingNotMinimal):
        read_bigsize_int(io.BytesIO(bfh('ff00000000ffffffff')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('fd00')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('feffff')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('ffffffffff')))
    self.assertEqual(None, read_bigsize_int(io.BytesIO(bfh(''))))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('fd')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('fe')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('ff')))
def test_read_bigsize_int(self):
    self.assertEqual(0, read_bigsize_int(io.BytesIO(bfh('00'))))
    self.assertEqual(252, read_bigsize_int(io.BytesIO(bfh('fc'))))
    self.assertEqual(253, read_bigsize_int(io.BytesIO(bfh('fd00fd'))))
    self.assertEqual(65535, read_bigsize_int(io.BytesIO(bfh('fdffff'))))
    self.assertEqual(65536, read_bigsize_int(io.BytesIO(bfh('fe00010000'))))
    self.assertEqual(4294967295, read_bigsize_int(io.BytesIO(bfh('feffffffff'))))
    self.assertEqual(4294967296, read_bigsize_int(io.BytesIO(bfh('ff0000000100000000'))))
    self.assertEqual(18446744073709551615, read_bigsize_int(io.BytesIO(bfh('ffffffffffffffffff'))))
    with self.assertRaises(FieldEncodingNotMinimal):
        read_bigsize_int(io.BytesIO(bfh('fd00fc')))
    with self.assertRaises(FieldEncodingNotMinimal):
        read_bigsize_int(io.BytesIO(bfh('fe0000ffff')))
    with self.assertRaises(FieldEncodingNotMinimal):
        read_bigsize_int(io.BytesIO(bfh('ff00000000ffffffff')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('fd00')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('feffff')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('ffffffffff')))
    self.assertEqual(None, read_bigsize_int(io.BytesIO(bfh())))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('fd')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('fe')))
    with self.assertRaises(UnexpectedEndOfStream):
        read_bigsize_int(io.BytesIO(bfh('ff')))