Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

this is a test for TunnelingTCP4ClientEndpoint - move into Http11ProxyTestCase

Konstantin Lopuhinb940606b7e3d
diff --git a/tests/test_downloader_handlers.py b/tests/test_downloader_handlers.py
index 2d6c05741..59320597e 100644
--- a/tests/test_downloader_handlers.py
+++ b/tests/test_downloader_handlers.py
@@ -388,16 +388,6 @@ class HttpProxyTestCase(unittest.TestCase):
request = Request('https://example.com', meta={'proxy': http_proxy})
return self.download_request(request, Spider('foo')).addCallback(_test)
- @defer.inlineCallbacks
- def test_download_with_proxy_https_timeout(self):
- http_proxy = self.getURL('')
- domain = 'https://no-such-domain.nosuch'
- request = Request(
- domain, meta={'proxy': http_proxy, 'download_timeout': 0.2})
- d = self.download_request(request, Spider('foo'))
- timeout = yield self.assertFailure(d, error.TimeoutError)
- self.assertIn(domain, timeout.osError)
-
def test_download_without_proxy(self):
def _test(response):
self.assertEquals(response.status, 200)
@@ -422,6 +412,17 @@ class Http11ProxyTestCase(HttpProxyTestCase):
if twisted_version < (11, 1, 0):
skip = 'HTTP1.1 not supported in twisted < 11.1.0'
+ @defer.inlineCallbacks
+ def test_download_with_proxy_https_timeout(self):
+ """ Test TunnelingTCP4ClientEndpoint """
+ http_proxy = self.getURL('')
+ domain = 'https://no-such-domain.nosuch'
+ request = Request(
+ domain, meta={'proxy': http_proxy, 'download_timeout': 0.2})
+ d = self.download_request(request, Spider('foo'))
+ timeout = yield self.assertFailure(d, error.TimeoutError)
+ self.assertIn(domain, timeout.osError)
+
class HttpDownloadHandlerMock(object):
def __init__(self, settings):