def test_queue_create_with_empty_json_body(self): queue_controller = pooling.QueueController(self.catalog) with mock.patch('zaqar.storage.pooling.Catalog.register') as register: queue_controller.create(self.queue, metadata={}, project=self.project) register.assert_called_with(self.queue, project=self.project, flavor=None)
def test_queues_list_on_multi_pools(self): def fake_list(project=None, marker=None, limit=10, detailed=False): yield iter([{'name': 'fake_queue'}]) list_str = 'zaqar.storage.mongodb.queues.QueueController.list' with mock.patch(list_str) as queues_list: queues_list.side_effect = fake_list queue_controller = pooling.QueueController(self.catalog) result = queue_controller.list(project=self.project) queue_list = list(next(result)) self.assertEqual(1, len(queue_list))