From: dano Date: Sun, 11 May 2014 02:27:40 +0000 (-0400) Subject: Add tests X-Git-Tag: v4.0.0b1~56^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea0df97aa21676c1111497642d13e3338f1cfeef;p=thirdparty%2Ftornado.git Add tests --- 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")