本文整理汇总了Python中pulp.server.db.migrate.models.MigrationModule._migrate_reply_queue方法的典型用法代码示例。如果您正苦于以下问题:Python MigrationModule._migrate_reply_queue方法的具体用法?Python MigrationModule._migrate_reply_queue怎么用?Python MigrationModule._migrate_reply_queue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.server.db.migrate.models.MigrationModule
的用法示例。
在下文中一共展示了MigrationModule._migrate_reply_queue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_migrate_reply_queue_not_found_does_not_delete_or_add_reply_queue
# 需要导入模块: from pulp.server.db.migrate.models import MigrationModule [as 别名]
# 或者: from pulp.server.db.migrate.models.MigrationModule import _migrate_reply_queue [as 别名]
def test_migrate_reply_queue_not_found_does_not_delete_or_add_reply_queue(self):
fake_broker = Mock()
fake_broker.getQueue.return_value = None
# test
migration = MigrationModule(MIGRATION)._module
migration._migrate_reply_queue(fake_broker)
# validation
fake_broker.getQueue.assert_called_with(Services.REPLY_QUEUE)
self.assertTrue(not self.mock_del_queue_catch_queue_in_use_exc.called)
self.assertTrue(not fake_broker.addQueue.called)
示例2: test_migrate_reply_queue_not_found
# 需要导入模块: from pulp.server.db.migrate.models import MigrationModule [as 别名]
# 或者: from pulp.server.db.migrate.models.MigrationModule import _migrate_reply_queue [as 别名]
def test_migrate_reply_queue_not_found(self):
fake_queue = Mock()
fake_broker = Mock()
fake_broker.getQueue.return_value = None
# test
migration = MigrationModule(MIGRATION)._module
migration._migrate_reply_queue(fake_broker)
# validation
fake_broker.getQueue.assert_called_with(Services.REPLY_QUEUE)
self.assertFalse(fake_broker.called)
self.assertFalse(fake_broker.called)
示例3: test_migrate_reply_queue
# 需要导入模块: from pulp.server.db.migrate.models import MigrationModule [as 别名]
# 或者: from pulp.server.db.migrate.models.MigrationModule import _migrate_reply_queue [as 别名]
def test_migrate_reply_queue(self):
fake_queue = Mock()
fake_queue.values = {
'exclusive': True,
'arguments': {}
}
fake_broker = Mock()
fake_broker.getQueue.return_value = fake_queue
# test
migration = MigrationModule(MIGRATION)._module
migration._migrate_reply_queue(fake_broker)
# validation
fake_broker.getQueue.assert_called_with(Services.REPLY_QUEUE)
fake_broker.delQueue.assert_called_with(Services.REPLY_QUEUE)
fake_broker.addQueue.assert_called_with(Services.REPLY_QUEUE, durable=True)
示例4: test_migrate_reply_queue_not_exclusive
# 需要导入模块: from pulp.server.db.migrate.models import MigrationModule [as 别名]
# 或者: from pulp.server.db.migrate.models.MigrationModule import _migrate_reply_queue [as 别名]
def test_migrate_reply_queue_not_exclusive(self):
fake_queue = Mock()
fake_queue.values = {
'exclusive': False,
'arguments': {}
}
fake_broker = Mock()
fake_broker.getQueue.return_value = fake_queue
# test
migration = MigrationModule(MIGRATION)._module
migration._migrate_reply_queue(fake_broker)
# validation
fake_broker.getQueue.assert_called_with(Services.REPLY_QUEUE)
self.assertFalse(fake_broker.called)
self.assertFalse(fake_broker.called)
示例5: test_migrate_reply_queue_not_exclusive_does_not_delete_or_add_reply_queue
# 需要导入模块: from pulp.server.db.migrate.models import MigrationModule [as 别名]
# 或者: from pulp.server.db.migrate.models.MigrationModule import _migrate_reply_queue [as 别名]
def test_migrate_reply_queue_not_exclusive_does_not_delete_or_add_reply_queue(self):
fake_queue = Mock()
fake_queue.values = {
'exclusive': False,
'arguments': {}
}
fake_broker = Mock()
fake_broker.getQueue.return_value = fake_queue
# test
migration = MigrationModule(MIGRATION)._module
migration._migrate_reply_queue(fake_broker)
# validation
fake_broker.getQueue.assert_called_with(Services.REPLY_QUEUE)
self.assertTrue(not self.mock_del_queue_catch_queue_in_use_exc.called)
self.assertTrue(not fake_broker.addQueue.called)
示例6: test_migrate_reply_queue_arguments_is_exclusive_deletes_and_add_reply_queue
# 需要导入模块: from pulp.server.db.migrate.models import MigrationModule [as 别名]
# 或者: from pulp.server.db.migrate.models.MigrationModule import _migrate_reply_queue [as 别名]
def test_migrate_reply_queue_arguments_is_exclusive_deletes_and_add_reply_queue(self):
fake_queue = Mock()
fake_queue.values = {
'exclusive': False,
'arguments': {'exclusive': True}
}
fake_broker = Mock()
fake_broker.getQueue.return_value = fake_queue
# test
migration = MigrationModule(MIGRATION)._module
migration._migrate_reply_queue(fake_broker)
# validation
fake_broker.getQueue.assert_called_with(Services.REPLY_QUEUE)
expected_call = call(fake_broker, Services.REPLY_QUEUE)
self.mock_del_queue_catch_queue_in_use_exc.assert_has_calls(expected_call)
fake_broker.addQueue.assert_called_with(Services.REPLY_QUEUE, durable=True)