'Test declare_queue sets ring_policy for celeryev.'

def test_queue_declare_set_ring_policy_for_celeryev(self):

    mock_queue = Mock()
    mock_queue.startswith.return_value = True
    mock_queue.endswith.return_value = False
    expected_default_options = {u'passive': False, u'durable': False, u'exclusive': False, u'auto-delete': True, u'arguments': None, u'qpid.policy_type': u'ring'}
    mock_msg_count = Mock()
    mock_consumer_count = Mock()
    values_dict = {u'msgDepth': mock_msg_count, u'consumerCount': mock_consumer_count}
    mock_queue_data = Mock()
    mock_queue_data.values = values_dict
    self.mock_broker.addQueue.return_value = None
    self.mock_broker.getQueue.return_value = mock_queue_data
    self.my_channel.queue_declare(mock_queue)
    mock_queue.startswith.assert_called_with(u'celeryev')
    self.mock_broker.addQueue.assert_called_with(mock_queue, options=expected_default_options)
