本文整理汇总了Python中pulp_puppet.common.sync_progress.SyncProgressReport.metadata_state方法的典型用法代码示例。如果您正苦于以下问题:Python SyncProgressReport.metadata_state方法的具体用法?Python SyncProgressReport.metadata_state怎么用?Python SyncProgressReport.metadata_state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp_puppet.common.sync_progress.SyncProgressReport
的用法示例。
在下文中一共展示了SyncProgressReport.metadata_state方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_forge_synchronization
# 需要导入模块: from pulp_puppet.common.sync_progress import SyncProgressReport [as 别名]
# 或者: from pulp_puppet.common.sync_progress.SyncProgressReport import metadata_state [as 别名]
def test_forge_synchronization(self, failed_call, mock_call):
conduit = Mock()
repository = Mock()
config = {constants.CONFIG_FEED: 'http://host/tmp/forge'}
# directory synchronization failure needed so the importer
# will retry using the forge synchronization.
failed_report = SyncProgressReport(conduit)
failed_report.metadata_state = constants.STATE_FAILED
failed_call.return_value = failed_report
progress_report = SyncProgressReport(conduit)
progress_report.metadata_state = constants.STATE_FAILED
mock_call.return_value = progress_report
# test
plugin = PuppetModuleImporter()
report = plugin.sync_repo(repository, conduit, config)
# validation
mock_call.assert_called_with()
self.assertEquals(report, conduit.build_failure_report.return_value)
示例2: test_directory_synchronization
# 需要导入模块: from pulp_puppet.common.sync_progress import SyncProgressReport [as 别名]
# 或者: from pulp_puppet.common.sync_progress.SyncProgressReport import metadata_state [as 别名]
def test_directory_synchronization(self, forge_call, mock_call):
conduit = Mock()
repository = Mock()
config = {constants.CONFIG_FEED: 'http://host/tmp/%s' % constants.MANIFEST_FILENAME}
progress_report = SyncProgressReport(conduit)
progress_report.metadata_state = constants.STATE_SUCCESS
progress_report.modules_state = constants.STATE_SUCCESS
mock_call.return_value = progress_report
# test
plugin = PuppetModuleImporter()
report = plugin.sync_repo(repository, conduit, config)
# validation
mock_call.assert_called_with(repository)
self.assertEquals(report, conduit.build_success_report.return_value)
self.assertFalse(forge_call.called)