Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use AsyncHTTPClient's defaults option in AsyncHTTPSTestCase.

Fix test_non_ssl_request, which has apparently been testing the wrong
thing for some time.
  • Loading branch information...
commit 080f285b9d9347d2c8d1a67118259ee02d3acd2b 1 parent 26078cd
Ben Darnell bdarnell authored
Showing with 4 additions and 6 deletions.
  1. +2 −1  tornado/test/httpserver_test.py
  2. +2 −5 tornado/testing.py
3  tornado/test/httpserver_test.py
View
@@ -89,7 +89,8 @@ def test_non_ssl_request(self):
# connection, rather than waiting for a timeout or otherwise
# misbehaving.
with ExpectLog(gen_log, '(SSL Error|uncaught exception)'):
- self.http_client.fetch(self.get_url("/"), self.stop,
+ self.http_client.fetch(self.get_url("/").replace('https:', 'http:'),
+ self.stop,
request_timeout=3600,
connect_timeout=3600)
response = self.wait()
7 tornado/testing.py
View
@@ -331,7 +331,8 @@ class AsyncHTTPSTestCase(AsyncHTTPTestCase):
def get_http_client(self):
# Some versions of libcurl have deadlock bugs with ssl,
# so always run these tests with SimpleAsyncHTTPClient.
- return SimpleAsyncHTTPClient(io_loop=self.io_loop, force_instance=True)
+ return SimpleAsyncHTTPClient(io_loop=self.io_loop, force_instance=True,
+ defaults=dict(validate_cert=False))
def get_httpserver_options(self):
return dict(ssl_options=self.get_ssl_options())
@@ -351,10 +352,6 @@ def get_ssl_options(self):
def get_protocol(self):
return 'https'
- def fetch(self, path, **kwargs):
- return AsyncHTTPTestCase.fetch(self, path, validate_cert=False,
- **kwargs)
-
class LogTrapTestCase(unittest.TestCase):
"""A test case that captures and discards all logging output
Please sign in to comment.
Something went wrong with that request. Please try again.