def test_set_queue_metadata(self): update_data = {'some': 'data'} with mock.patch.object(self.transport, 'send', autospec=True) as send_method: send_method.return_value = response.Response(None, None) req = request.Request() core.queue_exists(self.transport, req, update_data, 'test') self.assertIn('queue_name', req.params)
def test_queue_exists(self): with mock.patch.object(self.transport, 'send', autospec=True) as send_method: send_method.return_value = response.Response(None, None) req = request.Request() ret = core.queue_exists(self.transport, req, 'test') self.assertIn('queue_name', req.params) self.assertTrue(ret)
def test_queue_exists_not_found(self): with mock.patch.object(self.transport, 'send', autospec=True) as send_method: send_method.side_effect = errors.ResourceNotFound req = request.Request() ret = core.queue_exists(self.transport, req, 'test') self.assertIn('queue_name', req.params) self.assertFalse(ret)
def exists(self): """Checks if the queue exists.""" req, trans = self.client._request_and_transport() return core.queue_exists(trans, req, self._name)