Scrapy, a fast high-level web crawling & scraping framework for Python.
extra test
Mikhail Korobov84a3a9daac55
diff --git a/scrapy/tests/test_downloadermiddleware_ajaxcrawlable.py b/scrapy/tests/test_downloadermiddleware_ajaxcrawlable.pyindex ac5d86f9f..c820f78d3 100644--- a/scrapy/tests/test_downloadermiddleware_ajaxcrawlable.py+++ b/scrapy/tests/test_downloadermiddleware_ajaxcrawlable.py@@ -2,7 +2,7 @@ import unittestfrom scrapy.contrib.downloadermiddleware.ajaxcrawlable import AjaxCrawlableMiddlewarefrom scrapy.spider import BaseSpider-from scrapy.http import Request, HtmlResponse+from scrapy.http import Request, HtmlResponse, Responsefrom scrapy.utils.test import get_crawler__doctests__ = ['scrapy.contrib.downloadermiddleware.ajaxcrawlable']@@ -26,6 +26,12 @@ class AjaxCrawlableMiddlewareTest(unittest.TestCase):resp2 = self.mw.process_response(req, resp, self.spider)self.assertEqual(resp, resp2)+ def test_binary_response(self):+ req = Request('http://example.com/')+ resp = Response('http://example.com/', body=b'foobar\x00\x01\x02', request=req)+ resp2 = self.mw.process_response(req, resp, self.spider)+ self.assertIs(resp, resp2)+def test_ajax_crawlable(self):req, resp = self._req_resp('http://example.com/',@@ -49,4 +55,4 @@ class AjaxCrawlableMiddlewareTest(unittest.TestCase):def test_noncrawlable_body(self):req, resp = self._req_resp('http://example.com/', {}, {'body': '<html></html>'})resp2 = self.mw.process_response(req, resp, self.spider)- assert resp2 is resp+ self.assertIs(resp, resp2)