File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -572,13 +572,15 @@ def test_bytes_filename(self):
572
572
573
573
def test_decompress_limited (self ):
574
574
"""Decompressed data buffering should be limited"""
575
- bomb = igzip .compress (b'\0 ' * int (2e6 ), compresslevel = 3 )
576
- self .assertLess (len (bomb ), io .DEFAULT_BUFFER_SIZE )
575
+ bomb_size = int (2e6 )
576
+ self .assertLess (igzip .READ_BUFFER_SIZE , bomb_size )
577
+ bomb = gzip .compress (b'\0 ' * bomb_size , compresslevel = 9 )
578
+ self .assertLess (len (bomb ), igzip .READ_BUFFER_SIZE )
577
579
578
580
bomb = io .BytesIO (bomb )
579
581
decomp = igzip .GzipFile (fileobj = bomb )
580
582
self .assertEqual (decomp .read (1 ), b'\0 ' )
581
- max_decomp = 1 + io . DEFAULT_BUFFER_SIZE
583
+ max_decomp = 1 + igzip . READ_BUFFER_SIZE
582
584
self .assertLessEqual (decomp ._buffer .raw .tell (), max_decomp ,
583
585
"Excessive amount of data was decompressed" )
584
586
You can’t perform that action at this time.
0 commit comments