~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/errors.py

ivle.webapp.base.test:
 - Test named operations on JSONRESTView.
 - Check for MethodNotAllowed where appropriate, not BadRequest.

ivle.webapp.base.views#JSONRESTView:
 - Add named operation support.
 - Raise MethodNotAllowed instead of BadRequest for bad methods.

ivle.webapp.base.views#named_operation: Add. Decorator to export named ops.
ivle.webapp.errors: Add MethodNotAllowed (405).

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
class NotFound(HTTPError):
30
30
    code = 404
 
31
 
 
32
class MethodNotAllowed(HTTPError):
 
33
    code = 405