@@ -13,12 +13,36 @@ def test_single_gzip_buffer_closed(self):
1313 with self .assertRaises (KeyError ):
1414 _ = response .headers ["Content-Encoding" ]
1515
16+ def test_gzip_handler_after_reset (self ):
17+ response = self .gzip_request ("gzhandler-after-reset" )
18+ self .assertEqual (response .headers ["Content-Encoding" ], "gzip" )
19+
20+ def test_deflate_handler_after_reset (self ):
21+ response = self .deflate_request ("gzhandler-after-reset" )
22+ self .assertEqual (response .headers ["Content-Encoding" ], "deflate" )
23+
24+ def test_gzip_handler_with_nested_buffer (self ):
25+ response = self .gzip_request ("gzhandler-with-nested-buffer" )
26+ self .assertEqual (response .headers ["Content-Encoding" ], "gzip" )
27+
28+ def test_gzip_without_handler (self ):
29+ response = self .gzip_request ("gzhandler-absent" )
30+ with self .assertRaises (KeyError ):
31+ _ = response .headers ["Content-Encoding" ]
32+
1633 @pytest .mark .k2_skip
1734 def test_ignore_second_gzip_handler (self ):
1835 response = self .gzip_request ("ignore-second-handler" )
1936 with self .assertRaises (KeyError ):
2037 _ = response .headers ["Content-Encoding" ]
2138
39+ def deflate_request (self , type ):
40+ url = "/test_script_gzip_header?type=" + type
41+ return self .web_server .http_get (url , headers = {
42+ "Host" : "localhost" ,
43+ "Accept-Encoding" : "deflate"
44+ })
45+
2246 def gzip_request (self , type ):
2347 url = "/test_script_gzip_header?type=" + type
2448 return self .web_server .http_get (url , headers = {
0 commit comments