Lines Matching refs:to_bytes
1090 test.to_bytes(len(expected), byteorder, signed=signed),
1171 self.assertRaises(OverflowError, (256).to_bytes, 1, 'big', signed=False)
1172 self.assertRaises(OverflowError, (256).to_bytes, 1, 'big', signed=True)
1173 self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=False)
1174 self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=True)
1175 self.assertRaises(OverflowError, (-1).to_bytes, 2, 'big', signed=False)
1176 self.assertRaises(OverflowError, (-1).to_bytes, 2, 'little', signed=False)
1177 self.assertEqual((0).to_bytes(0, 'big'), b'')
1178 self.assertEqual((1).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x01')
1179 self.assertEqual((0).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x00')
1180 self.assertEqual((-1).to_bytes(5, 'big', signed=True),
1182 self.assertRaises(OverflowError, (1).to_bytes, 0, 'big')