当前位置: 首页>>代码示例>>Python>>正文


Python MigrationModule._del_queue_catch_queue_in_use_exception方法代码示例

本文整理汇总了Python中pulp.server.db.migrate.models.MigrationModule._del_queue_catch_queue_in_use_exception方法的典型用法代码示例。如果您正苦于以下问题:Python MigrationModule._del_queue_catch_queue_in_use_exception方法的具体用法?Python MigrationModule._del_queue_catch_queue_in_use_exception怎么用?Python MigrationModule._del_queue_catch_queue_in_use_exception使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pulp.server.db.migrate.models.MigrationModule的用法示例。


在下文中一共展示了MigrationModule._del_queue_catch_queue_in_use_exception方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test__del_queue_catch_no_queue_in_use_exception_catches_cannot_delete_queue

# 需要导入模块: from pulp.server.db.migrate.models import MigrationModule [as 别名]
# 或者: from pulp.server.db.migrate.models.MigrationModule import _del_queue_catch_queue_in_use_exception [as 别名]
    def test__del_queue_catch_no_queue_in_use_exception_catches_cannot_delete_queue(self):
        fake_broker = Mock()
        mock_name = Mock()
        exc_to_raise = Exception("Cannot delete queue celery; queue in use")
        fake_broker.delQueue.side_effect = exc_to_raise

        migration = MigrationModule(MIGRATION)._module
        try:
            migration._del_queue_catch_queue_in_use_exception(fake_broker, mock_name)
            self.fail('An exception should have been raised, and was not.')
        except Exception as error:
            string_a = 'Consumers are still bound to the queue'
            string_b = 'All consumers must be unregistered, upgraded, or off before you can continue'
            if string_a not in error.message or string_b not in error.message:
                self.fail("Migration 0009 does not handle a 'queue in use' exception")
开发者ID:CUXIDUMDUM,项目名称:pulp,代码行数:17,代码来源:test_migration_0009.py

示例2: test__del_queue_catch_no_queue_in_use_exception_calls_add_queue

# 需要导入模块: from pulp.server.db.migrate.models import MigrationModule [as 别名]
# 或者: from pulp.server.db.migrate.models.MigrationModule import _del_queue_catch_queue_in_use_exception [as 别名]
 def test__del_queue_catch_no_queue_in_use_exception_calls_add_queue(self):
     fake_broker = Mock()
     mock_name = Mock()
     migration = MigrationModule(MIGRATION)._module
     migration._del_queue_catch_queue_in_use_exception(fake_broker, mock_name)
     fake_broker.delQueue.assert_called_once_with(mock_name)
开发者ID:ipanova,项目名称:pulp,代码行数:8,代码来源:test_0009_qpid_queues.py


注:本文中的pulp.server.db.migrate.models.MigrationModule._del_queue_catch_queue_in_use_exception方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。