Lines Matching refs:from_bytes
1360 int.from_bytes(test, byteorder, signed=signed),
1371 int.from_bytes(test),
1476 self.assertIs(type(myint.from_bytes(b'\x00', 'big')), myint)
1477 self.assertEqual(myint.from_bytes(b'\x01', 'big'), 1)
1479 type(myint.from_bytes(b'\x00', 'big', signed=False)), myint)
1480 self.assertEqual(myint.from_bytes(b'\x01', 'big', signed=False), 1)
1481 self.assertIs(type(myint.from_bytes(b'\x00', 'little')), myint)
1482 self.assertEqual(myint.from_bytes(b'\x01', 'little'), 1)
1483 self.assertIs(type(myint.from_bytes(
1485 self.assertEqual(myint.from_bytes(b'\x01', 'little', signed=False), 1)
1487 int.from_bytes([255, 0, 0], 'big', signed=True), -65536)
1489 int.from_bytes((255, 0, 0), 'big', signed=True), -65536)
1490 self.assertEqual(int.from_bytes(
1492 self.assertEqual(int.from_bytes(
1494 self.assertEqual(int.from_bytes(
1496 self.assertEqual(int.from_bytes(
1498 self.assertRaises(ValueError, int.from_bytes, [256], 'big')
1499 self.assertRaises(ValueError, int.from_bytes, [0], 'big\x00')
1500 self.assertRaises(ValueError, int.from_bytes, [0], 'little\x00')
1501 self.assertRaises(TypeError, int.from_bytes, "", 'big')
1502 self.assertRaises(TypeError, int.from_bytes, "\x00", 'big')
1503 self.assertRaises(TypeError, int.from_bytes, 0, 'big')
1504 self.assertRaises(TypeError, int.from_bytes, 0, 'big', True)
1505 self.assertRaises(TypeError, myint.from_bytes, "", 'big')
1506 self.assertRaises(TypeError, myint.from_bytes, "\x00", 'big')
1507 self.assertRaises(TypeError, myint.from_bytes, 0, 'big')
1508 self.assertRaises(TypeError, int.from_bytes, 0, 'big', True)
1514 i = myint2.from_bytes(b'\x01', 'big')
1522 i = myint3.from_bytes(b'\x01', 'big')
1538 self.assertEqual(int.from_bytes(ValidBytes()), 1)
1539 self.assertRaises(TypeError, int.from_bytes, InvalidBytes())
1540 self.assertRaises(TypeError, int.from_bytes, MissingBytes())
1541 self.assertRaises(ZeroDivisionError, int.from_bytes, RaisingBytes())
1546 self.assertEqual(int.from_bytes(b'', SubStr('big')), 0)
1547 self.assertEqual(int.from_bytes(b'\x00', SubStr('little')), 0)
1554 self.assertIs(int.from_bytes(b, signed=True), i)