@@ -1374,16 +1374,15 @@ def equivalent_python(n, length, byteorder, signed=False):
13741374 check (tests4 , 'little' , signed = False )
13751375
13761376 self .assertRaises (OverflowError , (256 ).to_bytes , 1 , 'big' , signed = False )
1377- self .assertRaises (OverflowError , (256 ).to_bytes , 1 , 'big' , signed = True )
13781377 self .assertRaises (OverflowError , (256 ).to_bytes , 1 , 'little' , signed = False )
1379- self .assertRaises (OverflowError , (256 ).to_bytes , 1 , 'little' , signed = True )
13801378 self .assertRaises (OverflowError , (128 ).to_bytes , 1 , 'big' , signed = True )
13811379 self .assertRaises (OverflowError , (128 ).to_bytes , 1 , 'little' , signed = True )
13821380 self .assertRaises (OverflowError , (- 129 ).to_bytes , 1 , 'big' , signed = True )
13831381 self .assertRaises (OverflowError , (- 129 ).to_bytes , 1 , 'little' , signed = True )
13841382 self .assertRaises (OverflowError , (- 1 ).to_bytes , 2 , 'big' , signed = False )
13851383 self .assertRaises (OverflowError , (- 1 ).to_bytes , 2 , 'little' , signed = False )
13861384 self .assertEqual ((0 ).to_bytes (0 , 'big' ), b'' )
1385+ self .assertEqual ((0 ).to_bytes (0 , 'big' ), b'' , signed = True )
13871386 self .assertEqual ((1 ).to_bytes (5 , 'big' ), b'\x00 \x00 \x00 \x00 \x01 ' )
13881387 self .assertEqual ((0 ).to_bytes (5 , 'big' ), b'\x00 \x00 \x00 \x00 \x00 ' )
13891388 self .assertEqual ((- 1 ).to_bytes (5 , 'big' , signed = True ),
0 commit comments