mirror of https://github.com/scrapy/scrapy.git
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.
This commit is contained in:
parent
6427d60fd8
commit
8ada8f5f36
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue