From: dano Date: Sun, 11 May 2014 02:31:35 +0000 (-0400) Subject: Another test X-Git-Tag: v4.0.0b1~56^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=185a246bd5f096966624e352cdcc08eab00f9181;p=thirdparty%2Ftornado.git Another test --- diff --git a/tornado/test/curl_httpclient_test.py b/tornado/test/curl_httpclient_test.py index 6a592701a..259041b06 100644 --- a/tornado/test/curl_httpclient_test.py +++ b/tornado/test/curl_httpclient_test.py @@ -71,6 +71,10 @@ class CustomReasonHandler(RequestHandler): def get(self): self.set_status(200, "Custom reason") +class CustomFailReasonHandler(RequestHandler): + def get(self): + self.set_status(400, "Custom reason") + @unittest.skipIf(pycurl is None, "pycurl module not present") class CurlHTTPClientTestCase(AsyncHTTPTestCase): def setUp(self): @@ -82,6 +86,7 @@ class CurlHTTPClientTestCase(AsyncHTTPTestCase): return Application([ ('/digest', DigestAuthHandler), ('/custom_reason', CustomReasonHandler), + ('/custom_fail_reason', CustomFailReasonHandler), ]) def test_prepare_curl_callback_stack_context(self): @@ -108,3 +113,7 @@ class CurlHTTPClientTestCase(AsyncHTTPTestCase): def test_custom_reason(self): response = self.fetch('/custom_reason') self.assertEqual(response.reason, "Custom reason") + + def test_fail_custom_reason(self): + response = self.fetch('/custom_fail_reason') + self.assertEqual(str(response.error), "HTTP 400: Custom reason")