@@ -827,7 +827,7 @@ def check(tests, byteorder, signed=False):
827827 - 65536 : bytes (b'\xff \x00 \x00 ' ),
828828 - 8388608 : bytes (b'\x80 \x00 \x00 ' )
829829 }
830- # check(tests1, 'big', signed=True)
830+ check (tests1 , 'big' , signed = True )
831831
832832 # Convert integers to signed little-endian byte arrays.
833833 tests2 = {
@@ -849,7 +849,7 @@ def check(tests, byteorder, signed=False):
849849 - 65536 : bytes (b'\x00 \x00 \xff ' ),
850850 - 8388608 : bytes (b'\x00 \x00 \x80 ' )
851851 }
852- # check(tests2, 'little', signed=True)
852+ check (tests2 , 'little' , signed = True )
853853
854854 # Convert integers to unsigned big-endian byte arrays.
855855 tests3 = {
@@ -882,16 +882,16 @@ def check(tests, byteorder, signed=False):
882882 check (tests4 , 'little' , signed = False )
883883
884884 self .assertRaises (OverflowError , int (256 ).to_bytes , 1 , 'big' , signed = False )
885- # self.assertRaises(OverflowError, int(256).to_bytes, 1, 'big', signed=True)
885+ self .assertRaises (OverflowError , int (256 ).to_bytes , 1 , 'big' , signed = True )
886886 self .assertRaises (OverflowError , int (256 ).to_bytes , 1 , 'little' , signed = False )
887- # self.assertRaises(OverflowError, int(256).to_bytes, 1, 'little', signed=True)
887+ self .assertRaises (OverflowError , int (256 ).to_bytes , 1 , 'little' , signed = True )
888888 self .assertRaises (OverflowError , int (- 1 ).to_bytes , 2 , 'big' , signed = False ),
889889 self .assertRaises (OverflowError , int (- 1 ).to_bytes , 2 , 'little' , signed = False )
890890 self .assertEqual (int (0 ).to_bytes (0 , 'big' ), b'' )
891891 self .assertEqual (int (1 ).to_bytes (5 , 'big' ), b'\x00 \x00 \x00 \x00 \x01 ' )
892892 self .assertEqual (int (0 ).to_bytes (5 , 'big' ), b'\x00 \x00 \x00 \x00 \x00 ' )
893- # self.assertEqual(int(-1).to_bytes(5, 'big', signed=True),
894- # bytes(b'\xff\xff\xff\xff\xff'))
893+ self .assertEqual (int (- 1 ).to_bytes (5 , 'big' , signed = True ),
894+ bytes (b'\xff \xff \xff \xff \xff ' ))
895895 self .assertRaises (OverflowError , int (1 ).to_bytes , 0 , 'big' )
896896
897897 def test_from_bytes (self ):
0 commit comments