From 8ada8f5f36b3d2b4dd92dc7bb4822c909e2b6d03 Mon Sep 17 00:00:00 2001 From: duendex Date: Tue, 3 Dec 2013 12:55:44 -0200 Subject: [PATCH] Added a test case to ensure that passing the noconnect paramenter avoids trigerring the creation of a connect tunnel when downloading from a site with https scheme. --- scrapy/tests/test_downloader_handlers.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scrapy/tests/test_downloader_handlers.py b/scrapy/tests/test_downloader_handlers.py index 614bac037..14a26fe33 100644 --- a/scrapy/tests/test_downloader_handlers.py +++ b/scrapy/tests/test_downloader_handlers.py @@ -213,6 +213,16 @@ class HttpProxyTestCase(unittest.TestCase): request = Request('http://example.com', meta={'proxy': http_proxy}) return self.download_request(request, BaseSpider('foo')).addCallback(_test) + def test_download_with_proxy_https_noconnect(self): + def _test(response): + self.assertEquals(response.status, 200) + self.assertEquals(response.url, request.url) + self.assertEquals(response.body, 'https://example.com') + + http_proxy = '%s?noconnect' % self.getURL('') + request = Request('https://example.com', meta={'proxy': http_proxy}) + return self.download_request(request, BaseSpider('foo')).addCallback(_test) + def test_download_without_proxy(self): def _test(response): self.assertEquals(response.status, 200)