py3: fix http 1.1 test with https, and use self.host everywhere

This commit is contained in:
Konstantin Lopuhin 2016-01-18 12:42:21 +03:00
parent 04f69fd184
commit 98c060d0b2
1 changed files with 5 additions and 3 deletions

View File

@ -168,6 +168,9 @@ class HttpTestCase(unittest.TestCase):
@defer.inlineCallbacks
def test_timeout_download_from_spider(self):
if self.scheme == 'https':
raise unittest.SkipTest(
'test_timeout_download_from_spider skipped under https')
spider = Spider('foo')
meta = {'download_timeout': 0.2}
# client connects but no data is received
@ -181,7 +184,8 @@ class HttpTestCase(unittest.TestCase):
def test_host_header_not_in_request_headers(self):
def _test(response):
self.assertEquals(response.body, to_bytes('127.0.0.1:%d' % self.portno))
self.assertEquals(
response.body, to_bytes('%s:%d' % (self.host, self.portno)))
self.assertEquals(request.headers, {})
request = Request(self.getURL('host'))
@ -221,8 +225,6 @@ class Http10TestCase(HttpTestCase):
class Https10TestCase(Http10TestCase):
scheme = 'https'
def test_timeout_download_from_spider(self):
raise unittest.SkipTest("test_timeout_download_from_spider skipped under https")
class Http11TestCase(HttpTestCase):