Missing claim_count in mongodb MessageController _basic_message
Missing claim_count in mongodb MessageController _basic_message, When MessageController.get is executed, the result returned is different from redis and swift. Change-Id: Ieb01e0fa09f613e8871ec7fa381fbda6efc57e96
This commit is contained in:
parent
0540bbd6e1
commit
66537dd067
@ -984,6 +984,7 @@ def _basic_message(msg, now):
|
||||
'id': str(oid),
|
||||
'age': int(age),
|
||||
'ttl': msg['t'],
|
||||
'claim_count': msg['c'].get('c', 0),
|
||||
'body': msg['b'],
|
||||
'claim_id': str(msg['c']['id']) if msg['c']['id'] else None
|
||||
}
|
||||
|
@ -433,8 +433,8 @@ class MessageControllerTest(ControllerBaseTest):
|
||||
# Test Message Get
|
||||
message_out = self.controller.get(queue_name, message_id,
|
||||
project=self.project)
|
||||
self.assertEqual({'id', 'body', 'ttl', 'age', 'claim_id'},
|
||||
set(message_out))
|
||||
self.assertEqual({'id', 'body', 'ttl', 'age', 'claim_count',
|
||||
'claim_id'}, set(message_out))
|
||||
self.assertEqual(message_id, message_out['id'])
|
||||
self.assertEqual(message['body'], message_out['body'])
|
||||
self.assertEqual(message['ttl'], message_out['ttl'])
|
||||
@ -489,8 +489,8 @@ class MessageControllerTest(ControllerBaseTest):
|
||||
project=self.project)
|
||||
|
||||
for idx, message in enumerate(messages_out):
|
||||
self.assertEqual({'id', 'body', 'ttl', 'age', 'claim_id'},
|
||||
set(message))
|
||||
self.assertEqual({'id', 'body', 'ttl', 'age', 'claim_count',
|
||||
'claim_id'}, set(message))
|
||||
self.assertEqual(idx, message['body'])
|
||||
|
||||
self.controller.bulk_delete(self.queue_name, ids,
|
||||
|
Loading…
x
Reference in New Issue
Block a user