Exemple #1
0
 def test_respond_delete(self, func, session, request, cipher, user):
     request.method = "DELETE"
     request.headers = {'x-opp-phrase': "123"}
     cipher.return_value = "OK"
     handler = api.ResponseHandler(request, user, session)
     handler.respond()
     self._check_called(func)
Exemple #2
0
def handle_items():
    err = _enforce_content_type()
    if err:
        return err, 400
    handler = items.ResponseHandler(request)
    # Set require_phrase to True for all methods except DELETE
    response = handler.respond(request.method != 'DELETE')
    return _to_json(response)
Exemple #3
0
 def test_respond_delete(self, func, mock_get_session, request):
     request.method = "DELETE"
     request.headers = {'x-opp-phrase': "123"}
     handler = api.ResponseHandler(request)
     handler.respond()
     self._check_called(func)