Lines Matching refs:to_bytes
1109 test.to_bytes(len(expected), byteorder, signed=signed),
1190 self.assertRaises(OverflowError, (256).to_bytes, 1, 'big', signed=False)
1191 self.assertRaises(OverflowError, (256).to_bytes, 1, 'big', signed=True)
1192 self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=False)
1193 self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=True)
1194 self.assertRaises(OverflowError, (-1).to_bytes, 2, 'big', signed=False)
1195 self.assertRaises(OverflowError, (-1).to_bytes, 2, 'little', signed=False)
1196 self.assertEqual((0).to_bytes(0, 'big'), b'')
1197 self.assertEqual((1).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x01')
1198 self.assertEqual((0).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x00')
1199 self.assertEqual((-1).to_bytes(5, 'big', signed=True),
1201 self.assertRaises(OverflowError, (1).to_bytes, 0, 'big')