#NEWLINE# def test_aborter( self ) : #NEWLINE# #INDENT# abort = exceptions . abort #NEWLINE# self . assert_raises ( exceptions . BadRequest , abort , 400 ) #NEWLINE# self . assert_raises ( exceptions . Unauthorized , abort , 401 ) #NEWLINE# self . assert_raises ( exceptions . Forbidden , abort , 403 ) #NEWLINE# self . assert_raises ( exceptions . NotFound , abort , 404 ) #NEWLINE# self . assert_raises ( exceptions . MethodNotAllowed , abort , 405 , [ 'GET' , 'HEAD' ] ) #NEWLINE# self . assert_raises ( exceptions . NotAcceptable , abort , 406 ) #NEWLINE# self . assert_raises ( exceptions . RequestTimeout , abort , 408 ) #NEWLINE# self . assert_raises ( exceptions . Gone , abort , 410 ) #NEWLINE# self . assert_raises ( exceptions . LengthRequired , abort , 411 ) #NEWLINE# self . assert_raises ( exceptions . PreconditionFailed , abort , 412 ) #NEWLINE# self . assert_raises ( exceptions . RequestEntityTooLarge , abort , 413 ) #NEWLINE# self . assert_raises ( exceptions . RequestURITooLarge , abort , 414 ) #NEWLINE# self . assert_raises ( exceptions . UnsupportedMediaType , abort , 415 ) #NEWLINE# self . assert_raises ( exceptions . UnprocessableEntity , abort , 422 ) #NEWLINE# self . assert_raises ( exceptions . InternalServerError , abort , 500 ) #NEWLINE# self . assert_raises ( exceptions . NotImplemented , abort , 501 ) #NEWLINE# self . assert_raises ( exceptions . BadGateway , abort , 502 ) #NEWLINE# self . assert_raises ( exceptions . ServiceUnavailable , abort , 503 ) #NEWLINE# myabort = exceptions . Aborter ( { #NEWLINE# #INDENT# 1 : exceptions . NotFound , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assert_raises ( LookupError , myabort , 404 ) #NEWLINE# self . assert_raises ( exceptions . NotFound , myabort , 1 ) #NEWLINE# myabort = exceptions . Aborter ( extra = { #NEWLINE# #INDENT# 1 : exceptions . NotFound , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assert_raises ( exceptions . NotFound , myabort , 404 ) #NEWLINE# self . assert_raises ( exceptions . NotFound , myabort , 1 )