本文整理汇总了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")
示例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)