File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -576,6 +576,14 @@ def setUp(self):
576
576
with open (path , 'wb' ) as temp :
577
577
temp .write (self .data )
578
578
579
+ # create big files, size > 2 << 18
580
+ self .repeat = (2 << 19 ) // len (self .data )
581
+ for ext in self .compressible_ext :
582
+ path = os .path .join (self .tempdir , 'test_big.{}' .format (ext ))
583
+ with open (path , 'wb' ) as temp :
584
+ for _ in range (self .repeat ):
585
+ temp .write (self .data )
586
+
579
587
def tearDown (self ):
580
588
try :
581
589
os .chdir (self .cwd )
@@ -622,7 +630,14 @@ def test_header_set_supported_extension(self):
622
630
headers = {'Accept-Encoding' : 'gzip' })
623
631
self .assertTrue ('Content-Encoding' in response .headers )
624
632
self .assertEqual (gzip .decompress (response .read ()), self .data )
625
-
633
+
634
+ # same for big files
635
+ for ext in self .compressible_ext :
636
+ response = self .request (self .base_url + '/test_big.{}' .format (ext ),
637
+ headers = {'Accept-Encoding' : 'gzip' })
638
+ self .assertTrue ('Content-Encoding' in response .headers )
639
+ self .assertEqual (gzip .decompress (response .read ()),
640
+ self .repeat * self .data )
626
641
627
642
cgi_file1 = """\
628
643
#!%s
You can’t perform that action at this time.
0 commit comments