From: Ben Darnell Date: Mon, 19 Nov 2012 15:14:01 +0000 (-0500) Subject: Use AsyncHTTPClient's defaults option in AsyncHTTPSTestCase. X-Git-Tag: v3.0.0~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=080f285b9d9347d2c8d1a67118259ee02d3acd2b;p=thirdparty%2Ftornado.git Use AsyncHTTPClient's defaults option in AsyncHTTPSTestCase. Fix test_non_ssl_request, which has apparently been testing the wrong thing for some time. --- diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py index d0331240c..fbcec0b07 100644 --- a/tornado/test/httpserver_test.py +++ b/tornado/test/httpserver_test.py @@ -89,7 +89,8 @@ class SSLTestMixin(object): # 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() diff --git a/tornado/testing.py b/tornado/testing.py index 36928c446..594564336 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -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 @@ class AsyncHTTPSTestCase(AsyncHTTPTestCase): 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