def test_http_uri_too_long_with_title_and_desc_and_challenges(self): try: raise falcon.HTTPUriTooLong(title='Test', description='Testdescription') except falcon.HTTPUriTooLong as e: self.assertEqual('Test', e.title, 'Title should be "Test"') self.assertEqual('Testdescription', e.description, 'Description should be "Testdescription"')
def test_http_uri_too_long_no_title_and_desc_and_challenges(self): try: raise falcon.HTTPUriTooLong() except falcon.HTTPUriTooLong as e: self.assertEqual(status.HTTP_414, e.title, 'The title should be ' + status.HTTP_414 + ', but it is: ' + e.title) self.assertEqual(None, e.description, 'The description should be None')
def on_get(self, req, resp): raise falcon.HTTPUriTooLong(title=self.title, description=self.description, code=self.code)