Python werkzeug.exceptions.BadGateway() Examples
The following are 2
code examples of werkzeug.exceptions.BadGateway().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
werkzeug.exceptions
, or try the search function
.
Example #1
Source File: exceptions.py From Flask with Apache License 2.0 | 5 votes |
def test_aborter(self): abort = exceptions.abort self.assert_raises(exceptions.BadRequest, abort, 400) self.assert_raises(exceptions.Unauthorized, abort, 401) self.assert_raises(exceptions.Forbidden, abort, 403) self.assert_raises(exceptions.NotFound, abort, 404) self.assert_raises(exceptions.MethodNotAllowed, abort, 405, ['GET', 'HEAD']) self.assert_raises(exceptions.NotAcceptable, abort, 406) self.assert_raises(exceptions.RequestTimeout, abort, 408) self.assert_raises(exceptions.Gone, abort, 410) self.assert_raises(exceptions.LengthRequired, abort, 411) self.assert_raises(exceptions.PreconditionFailed, abort, 412) self.assert_raises(exceptions.RequestEntityTooLarge, abort, 413) self.assert_raises(exceptions.RequestURITooLarge, abort, 414) self.assert_raises(exceptions.UnsupportedMediaType, abort, 415) self.assert_raises(exceptions.UnprocessableEntity, abort, 422) self.assert_raises(exceptions.InternalServerError, abort, 500) self.assert_raises(exceptions.NotImplemented, abort, 501) self.assert_raises(exceptions.BadGateway, abort, 502) self.assert_raises(exceptions.ServiceUnavailable, abort, 503) myabort = exceptions.Aborter({1: exceptions.NotFound}) self.assert_raises(LookupError, myabort, 404) self.assert_raises(exceptions.NotFound, myabort, 1) myabort = exceptions.Aborter(extra={1: exceptions.NotFound}) self.assert_raises(exceptions.NotFound, myabort, 404) self.assert_raises(exceptions.NotFound, myabort, 1)
Example #2
Source File: exceptions.py From Flask with Apache License 2.0 | 5 votes |
def test_aborter(self): abort = exceptions.abort self.assert_raises(exceptions.BadRequest, abort, 400) self.assert_raises(exceptions.Unauthorized, abort, 401) self.assert_raises(exceptions.Forbidden, abort, 403) self.assert_raises(exceptions.NotFound, abort, 404) self.assert_raises(exceptions.MethodNotAllowed, abort, 405, ['GET', 'HEAD']) self.assert_raises(exceptions.NotAcceptable, abort, 406) self.assert_raises(exceptions.RequestTimeout, abort, 408) self.assert_raises(exceptions.Gone, abort, 410) self.assert_raises(exceptions.LengthRequired, abort, 411) self.assert_raises(exceptions.PreconditionFailed, abort, 412) self.assert_raises(exceptions.RequestEntityTooLarge, abort, 413) self.assert_raises(exceptions.RequestURITooLarge, abort, 414) self.assert_raises(exceptions.UnsupportedMediaType, abort, 415) self.assert_raises(exceptions.UnprocessableEntity, abort, 422) self.assert_raises(exceptions.InternalServerError, abort, 500) self.assert_raises(exceptions.NotImplemented, abort, 501) self.assert_raises(exceptions.BadGateway, abort, 502) self.assert_raises(exceptions.ServiceUnavailable, abort, 503) myabort = exceptions.Aborter({1: exceptions.NotFound}) self.assert_raises(LookupError, myabort, 404) self.assert_raises(exceptions.NotFound, myabort, 1) myabort = exceptions.Aborter(extra={1: exceptions.NotFound}) self.assert_raises(exceptions.NotFound, myabort, 404) self.assert_raises(exceptions.NotFound, myabort, 1)