From ea0df97aa21676c1111497642d13e3338f1cfeef Mon Sep 17 00:00:00 2001 From: dano Date: Sat, 10 May 2014 22:27:40 -0400 Subject: [PATCH] Add tests --- tornado/test/curl_httpclient_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tornado/test/curl_httpclient_test.py b/tornado/test/curl_httpclient_test.py index fb6965648..6a592701a 100644 --- a/tornado/test/curl_httpclient_test.py +++ b/tornado/test/curl_httpclient_test.py @@ -67,6 +67,9 @@ class DigestAuthHandler(RequestHandler): 'Digest realm="%s", nonce="%s", opaque="%s"' % (realm, nonce, opaque)) +class CustomReasonHandler(RequestHandler): + def get(self): + self.set_status(200, "Custom reason") @unittest.skipIf(pycurl is None, "pycurl module not present") class CurlHTTPClientTestCase(AsyncHTTPTestCase): @@ -78,6 +81,7 @@ class CurlHTTPClientTestCase(AsyncHTTPTestCase): def get_app(self): return Application([ ('/digest', DigestAuthHandler), + ('/custom_reason', CustomReasonHandler), ]) def test_prepare_curl_callback_stack_context(self): @@ -100,3 +104,7 @@ class CurlHTTPClientTestCase(AsyncHTTPTestCase): response = self.fetch('/digest', auth_mode='digest', auth_username='foo', auth_password='bar') self.assertEqual(response.body, b'ok') + + def test_custom_reason(self): + response = self.fetch('/custom_reason') + self.assertEqual(response.reason, "Custom reason") -- 2.47.2