Fix assert error during queue creating in ut

In some concurrent test case, the queue may be created
more than one time in the setup function. Since the queue
in Zaqar is lazy, it returns 201 or 204 in this case.

This fixes some additional tests that weren't covered in
commit 8e0dd9763a.

Change-Id: Iec341c83cdd28d6db50b2e456d082431a62846af
Co-Authored-By: Thomas Goirand <zigo@debian.org>
Closes-Bug: #1777645
This commit is contained in:
Corey Bryant 2018-06-19 08:47:56 -04:00
parent 51816928ac
commit b9e5cc5ecb
1 changed files with 3 additions and 3 deletions

View File

@ -173,7 +173,7 @@ class QueueLifecycleBaseTest(base.V2Base):
def validator(resp, isBinary):
resp = json.loads(resp)
self.assertEqual(201, resp['headers']['status'])
self.assertIn(resp['headers']['status'], [201, 204])
sender.side_effect = validator
self.protocol.onMessage(req, False)
@ -218,7 +218,7 @@ class QueueLifecycleBaseTest(base.V2Base):
def validator(resp, isBinary):
resp = json.loads(resp)
self.assertEqual(201, resp['headers']['status'])
self.assertIn(resp['headers']['status'], [201, 204])
sender.side_effect = validator
self.protocol.onMessage(req, False)
@ -268,7 +268,7 @@ class QueueLifecycleBaseTest(base.V2Base):
def validator(resp, isBinary):
resp = json.loads(resp)
self.assertEqual(201, resp['headers']['status'])
self.assertIn(resp['headers']['status'], [201, 204])
sender.side_effect = validator
self.protocol.onMessage(req, False)