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


Python SyncProgressReport.metadata_state方法代码示例

本文整理汇总了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)
开发者ID:asmacdo,项目名称:pulp_puppet,代码行数:25,代码来源:test_importer.py

示例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)
开发者ID:asmacdo,项目名称:pulp_puppet,代码行数:21,代码来源:test_importer.py


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