]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Use AsyncHTTPClient's defaults option in AsyncHTTPSTestCase.
authorBen Darnell <ben@bendarnell.com>
Mon, 19 Nov 2012 15:14:01 +0000 (10:14 -0500)
committerBen Darnell <ben@bendarnell.com>
Mon, 19 Nov 2012 15:14:01 +0000 (10:14 -0500)
Fix test_non_ssl_request, which has apparently been testing the wrong
thing for some time.

tornado/test/httpserver_test.py
tornado/testing.py

index d0331240c9d6b78a9260b5718a1521b2077bb378..fbcec0b0799f6562ac16e2dbef58b32b0916bf37 100644 (file)
@@ -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()
index 36928c446244e4015ce6a872316ed735a09f18b7..5945643366f7c8f7f844ec284ea774b435187846 100644 (file)
@@ -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