コード例 #1
0
ファイル: test_agent.py プロジェクト: credativ/pulp
    def test_delete_queue(self, queue, add_connector):
        url = 'test-url'
        name = 'test-queue'

        # test
        agent = PulpAgent()
        agent.delete_queue(url, name)

        # validation
        add_connector.assert_called_once_with()
        queue.assert_called_once_with(name, url)
        queue.return_value.purge.assert_called_once_with()
        queue.return_value.delete.assert_called_once_with()
コード例 #2
0
    def test_delete_queue(self, queue, add_connector):
        url = 'test-url'
        name = 'test-queue'

        # test
        agent = PulpAgent()
        agent.delete_queue(url, name)

        # validation
        add_connector.assert_called_once_with()
        queue.assert_called_once_with(name, url)
        queue.return_value.purge.assert_called_once_with()
        queue.return_value.delete.assert_called_once_with()
コード例 #3
0
ファイル: test_agent.py プロジェクト: credativ/pulp
    def test_delete_queue_not_found(self, queue, add_connector):
        url = 'test-url'
        name = 'test-queue'
        queue.return_value.purge.side_effect = NotFound

        # test
        agent = PulpAgent()
        agent.delete_queue(url, name)

        # validation
        add_connector.assert_called_once_with()
        queue.assert_called_once_with(name, url)
        queue.return_value.purge.assert_called_once_with()
        self.assertFalse(queue.delete.called)
コード例 #4
0
    def test_delete_queue_not_found(self, queue, add_connector):
        url = 'test-url'
        name = 'test-queue'
        queue.return_value.purge.side_effect = NotFound

        # test
        agent = PulpAgent()
        agent.delete_queue(url, name)

        # validation
        add_connector.assert_called_once_with()
        queue.assert_called_once_with(name, url)
        queue.return_value.purge.assert_called_once_with()
        self.assertFalse(queue.delete.called)
コード例 #5
0
 def delete_queue(url, name, consumer_id):
     """
     Delete the agent queue.
     :param url: The broker URL.
     :type url: str
     :param name: The queue name.
     :type name: str
     :param consumer_id: The consumer ID.
     :type consumer_id: str
     """
     try:
         manager = managers.consumer_manager()
         manager.get_consumer(consumer_id)
         return  # still registered (abort)
     except MissingResource:
         # expected
         pass
     agent = PulpAgent()
     agent.delete_queue(url, name)
コード例 #6
0
ファイル: agent.py プロジェクト: hgschmie/pulp
 def delete_queue(url, name, consumer_id):
     """
     Delete the agent queue.
     :param url: The broker URL.
     :type url: str
     :param name: The queue name.
     :type name: str
     :param consumer_id: The consumer ID.
     :type consumer_id: str
     """
     try:
         manager = managers.consumer_manager()
         manager.get_consumer(consumer_id)
         return  # still registered (abort)
     except MissingResource:
         # expected
         pass
     agent = PulpAgent()
     agent.delete_queue(url, name)