From f3a41326847456b0274f1c6b47afd2427efd73b8 Mon Sep 17 00:00:00 2001 From: Eva Balycheva Date: Tue, 15 Mar 2016 06:44:55 +0300 Subject: [PATCH] Fix cleanup in metadata putting test Now, if you will try to run two times this command: tox -e py27 wsgi.v2_0.test_validation.TestValidation.test_queue_metadata _putting You will see: MismatchError: '201 Created' != '204 No Content' This is because cleanUp() is not written good in this test case. self.simulate_delete function has missing argument: project id, so the default project id is used instead during cleanUp(). The problem went unnoticed, because we usually run all tests. And when all tests run the database is somehow cleaned in the place we need to clean. Change-Id: Id0241aeb76aabcb5e57098b0f02d26e62aead42e --- zaqar/tests/unit/transport/wsgi/v2_0/test_validation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zaqar/tests/unit/transport/wsgi/v2_0/test_validation.py b/zaqar/tests/unit/transport/wsgi/v2_0/test_validation.py index fa2062d2..d2630be6 100644 --- a/zaqar/tests/unit/transport/wsgi/v2_0/test_validation.py +++ b/zaqar/tests/unit/transport/wsgi/v2_0/test_validation.py @@ -121,7 +121,8 @@ class TestValidation(base.V2Base): self.simulate_put(queue_1, self.project_id, body='{"_default_message_ttl": 60}') - self.addCleanup(self.simulate_delete, queue_1, headers=self.headers) + self.addCleanup(self.simulate_delete, queue_1, self.project_id, + headers=self.headers) self.assertEqual(falcon.HTTP_201, self.srmock.status) # TTL under min @@ -142,7 +143,8 @@ class TestValidation(base.V2Base): self.simulate_put(queue_2, self.project_id, body='{"_max_messages_post_size": 255}') - self.addCleanup(self.simulate_delete, queue_2, headers=self.headers) + self.addCleanup(self.simulate_delete, queue_2, self.project_id, + headers=self.headers) self.assertEqual(falcon.HTTP_201, self.srmock.status) # Size over max