'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):
def get_app(self):
return Application([
('/digest', DigestAuthHandler),
+ ('/custom_reason', CustomReasonHandler),
])
def test_prepare_curl_callback_stack_context(self):
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")