示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
 def exists(self):
     """Checks if the queue exists."""
     req, trans = self.client._request_and_transport()
     return core.queue_exists(trans, req, self._name)
示例#5
0
 def exists(self):
     """Checks if the queue exists."""
     req, trans = self.client._request_and_transport()
     return core.queue_exists(trans, req, self._name)