From ca2e1d299fd80bda93ddbc7d392a4e14c01db35a Mon Sep 17 00:00:00 2001 From: kgriffs Date: Mon, 24 Feb 2014 15:04:20 -0600 Subject: [PATCH] test(wsgi): Enable test_default_limits and fix UUID bug The test_default_limits module was not being run. I remedied that, and subsequently discovered that the fixture method, "_prepare_messages", had a bug where it was not using a valid UUID for the "Client-ID" header. Change-Id: I60d4ac76f50af110022e4f923c82cbdb16919e86 --- .../transport/wsgi/{wsgi => }/test_default_limits.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) rename tests/unit/queues/transport/wsgi/{wsgi => }/test_default_limits.py (91%) diff --git a/tests/unit/queues/transport/wsgi/wsgi/test_default_limits.py b/tests/unit/queues/transport/wsgi/test_default_limits.py similarity index 91% rename from tests/unit/queues/transport/wsgi/wsgi/test_default_limits.py rename to tests/unit/queues/transport/wsgi/test_default_limits.py index cfbec7377..a3f7e4aab 100644 --- a/tests/unit/queues/transport/wsgi/wsgi/test_default_limits.py +++ b/tests/unit/queues/transport/wsgi/test_default_limits.py @@ -24,12 +24,12 @@ from . import base # noqa from marconi.queues import storage -class DefaultLimitsTest(base.TestBase): +class TestDefaultLimits(base.TestBase): config_file = 'wsgi_sqlite_default_limits.conf' def setUp(self): - super(DefaultLimitsTest, self).setUp() + super(TestDefaultLimits, self).setUp() self.queue_path = '/v1/queues/q1' self.messages_path = self.queue_path + '/messages' @@ -39,7 +39,7 @@ class DefaultLimitsTest(base.TestBase): def tearDown(self): self.simulate_delete(self.queue_path) - super(DefaultLimitsTest, self).tearDown() + super(TestDefaultLimits, self).tearDown() def test_queue_listing(self): # 2 queues to list @@ -92,4 +92,6 @@ class DefaultLimitsTest(base.TestBase): def _prepare_messages(self, count): doc = json.dumps([{'body': 239, 'ttl': 300}] * count) self.simulate_post(self.messages_path, body=doc, - headers={'Client-ID': 'poster'}) + headers={'Client-ID': str(uuid.uuid4())}) + + self.assertEqual(self.srmock.status, falcon.HTTP_201)