Exemplo n.º 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)
 def exists(self):
     """Checks if the queue exists."""
     req, trans = self.client._request_and_transport()
     if self.client.api_version >= 1.1:
         raise errors.InvalidOperation("Unavailable on versions >= 1.1")
     else:
         return core.queue_exists(trans, req, self._name)
Exemplo n.º 3
0
 def exists(self):
     """Checks if the queue exists."""
     req, trans = self.client._request_and_transport()
     if self.client.api_version >= 1.1:
         raise errors.InvalidOperation("Unavailable on versions >= 1.1")
     else:
         return core.queue_exists(trans, req, self._name)
Exemplo n.º 4
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)
Exemplo n.º 5
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)
Exemplo n.º 6
0
 def exists(self):
     """Checks if the queue exists."""
     req, trans = self.client._request_and_transport()
     return core.queue_exists(trans, req, self._name)
Exemplo n.º 7
0
 def exists(self):
     """Checks if the queue exists."""
     req, trans = self.client._request_and_transport()
     return core.queue_exists(trans, req, self._name)