Merge "feat(wsgi): claim creation returns 201"

This commit is contained in:
Jenkins 2013-08-09 15:04:29 +00:00 committed by Gerrit Code Review
commit 88e25350e1
2 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ class ClaimsBaseTest(base.TestBase):
# First, claim some messages
body = self.simulate_post(self.claims_path, self.project_id, body=doc)
self.assertEquals(self.srmock.status, falcon.HTTP_200)
self.assertEquals(self.srmock.status, falcon.HTTP_201)
claimed = json.loads(body[0])
claim_href = self.srmock.headers_dict['Location']

View File

@ -88,7 +88,7 @@ class CollectionResource(object):
resp.location = req.path + '/' + cid
resp.body = helpers.to_json(resp_msgs)
resp.status = falcon.HTTP_200
resp.status = falcon.HTTP_201
else:
resp.status = falcon.HTTP_204
@ -117,7 +117,7 @@ class ItemResource(object):
meta['messages'] = list(msgs)
except storage_exceptions.DoesNotExist:
raise falcon.HTTPNotFound
raise falcon.HTTPNotFound()
except Exception as ex:
LOG.exception(ex)
description = _('Claim could not be queried.')
@ -163,7 +163,7 @@ class ItemResource(object):
resp.status = falcon.HTTP_204
except storage_exceptions.DoesNotExist:
raise falcon.HTTPNotFound
raise falcon.HTTPNotFound()
except Exception as ex:
LOG.exception(ex)
description = _('Claim could not be updated.')