Skip to content

Commit

Permalink
Redefined test for scrapy#193
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Vereecken authored and chekunkov committed Apr 26, 2014
1 parent df33d4a commit 8a46a4e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scrapy/tests/test_downloadermiddleware_httpcompression.py
Expand Up @@ -135,3 +135,12 @@ def test_process_response_force_recalculate_encoding(self):
self.assertEqual(newresponse.body, plainbody)
self.assertEqual(newresponse.encoding, resolve_encoding('gb2312'))

def test_process_response_gzipped_contenttype(self):
response = self._getresponse('gzip')
response.headers['Content-Type'] = 'application/gzip'
request = response.request

newresponse = self.mw.process_response(request, response, self.spider)
self.assertIs(newresponse, response)
self.assertEqual(response.headers['Content-Encoding'], 'gzip')
self.assertEqual(response.headers['Content-Type'], 'application/gzip')

0 comments on commit 8a46a4e

Please sign in to comment.