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
This commit is contained in:
kgriffs 2014-02-24 15:04:20 -06:00
parent 6f35b343fe
commit ca2e1d299f

View File

@ -24,12 +24,12 @@ from . import base # noqa
from marconi.queues import storage from marconi.queues import storage
class DefaultLimitsTest(base.TestBase): class TestDefaultLimits(base.TestBase):
config_file = 'wsgi_sqlite_default_limits.conf' config_file = 'wsgi_sqlite_default_limits.conf'
def setUp(self): def setUp(self):
super(DefaultLimitsTest, self).setUp() super(TestDefaultLimits, self).setUp()
self.queue_path = '/v1/queues/q1' self.queue_path = '/v1/queues/q1'
self.messages_path = self.queue_path + '/messages' self.messages_path = self.queue_path + '/messages'
@ -39,7 +39,7 @@ class DefaultLimitsTest(base.TestBase):
def tearDown(self): def tearDown(self):
self.simulate_delete(self.queue_path) self.simulate_delete(self.queue_path)
super(DefaultLimitsTest, self).tearDown() super(TestDefaultLimits, self).tearDown()
def test_queue_listing(self): def test_queue_listing(self):
# 2 queues to list # 2 queues to list
@ -92,4 +92,6 @@ class DefaultLimitsTest(base.TestBase):
def _prepare_messages(self, count): def _prepare_messages(self, count):
doc = json.dumps([{'body': 239, 'ttl': 300}] * count) doc = json.dumps([{'body': 239, 'ttl': 300}] * count)
self.simulate_post(self.messages_path, body=doc, 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)