Merge "Add test for claim for non existing queue"

This commit is contained in:
Zuul 2018-03-23 06:25:45 +00:00 committed by Gerrit Code Review
commit f6c761d213
1 changed files with 13 additions and 0 deletions

View File

@ -274,6 +274,19 @@ class TestClaimsNegative(base.BaseV2MessagingTest):
self.assertRaises(lib_exc.Unauthorized,
self.client.post_claims, self.queue_name, claim_body)
@decorators.attr(type=['negative'])
@decorators.idempotent_id('3c8b5ae5-31ea-4063-b1a6-67915d9b5f70')
def test_claim_messages_non_existent_queue(self):
non_existent_queue = data_utils.rand_name('rand_queuename')
claim_ttl = data_utils.rand_int_id(start=60,
end=CONF.messaging.max_claim_ttl)
claim_grace = data_utils.\
rand_int_id(start=60, end=CONF.messaging.max_claim_grace)
claim_body = {"ttl": claim_ttl, "grace": claim_grace}
resp, _ = self.client.post_claims(non_existent_queue,
claim_body)
self.assertEqual('204', resp['status'])
# Query Claim
@decorators.attr(type=['negative'])