• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python publish_step.UnitPublishStep类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pulp.plugins.util.publish_step.UnitPublishStep的典型用法代码示例。如果您正苦于以下问题:Python UnitPublishStep类的具体用法?Python UnitPublishStep怎么用?Python UnitPublishStep使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: test_get_total_ignore_filter

 def test_get_total_ignore_filter(self):
     step = UnitPublishStep("foo", ['bar', 'baz'])
     step.association_filters = {'foo': 'bar'}
     step.parent = Mock()
     step.parent.repo.content_unit_counts.get.return_value = 1
     total = step._get_total(ignore_filter=True)
     self.assertEquals(2, total)
开发者ID:hgschmie,项目名称:pulp,代码行数:7,代码来源:test_publish_step.py


示例2: test_process_step_no_units

 def test_process_step_no_units(self, mock_get_units):
     self.publisher.repo.content_unit_counts = {'FOO_TYPE': 0}
     mock_method = Mock()
     mock_get_units.return_value = []
     step = UnitPublishStep('foo_step', 'FOO_TYPE')
     step.parent = self.publisher
     step.process_unit = mock_method
     step.process()
     self.assertEquals(step.state, reporting_constants.STATE_COMPLETE)
     self.assertFalse(mock_method.called)
开发者ID:hgschmie,项目名称:pulp,代码行数:10,代码来源:test_publish_step.py


示例3: test_get_with_association_filter

    def test_get_with_association_filter(self, mock_manager_factory):
        step = UnitPublishStep("foo", ['bar', 'baz'])
        step.association_filters = {'foo': 'bar'}

        find_by_criteria = mock_manager_factory.repo_unit_association_query_manager.return_value.\
            find_by_criteria
        find_by_criteria.return_value.count.return_value = 5
        total = step._get_total()
        criteria_object = find_by_criteria.call_args[0][0]
        compare_dict(criteria_object.filters, {'foo': 'bar',
                                               'unit_type_id': {'$in': ['bar', 'baz']}})
        self.assertEquals(5, total)
开发者ID:hgschmie,项目名称:pulp,代码行数:12,代码来源:test_publish_step.py


示例4: test_process_step_cancelled_mid_unit_processing

    def test_process_step_cancelled_mid_unit_processing(self, mock_get_units):
        self.publisher.repo.content_unit_counts = {'FOO_TYPE': 2}
        mock_get_units.return_value = ['cancel', 'bar_unit']
        step = UnitPublishStep('foo_step', 'FOO_TYPE')
        self.publisher.add_child(step)

        step.process_unit = self._step_canceler
        step.process()

        self.assertEquals(step.state, reporting_constants.STATE_CANCELLED)
        self.assertEquals(step.progress_successes, 1)
        self.assertEquals(step.progress_failures, 0)
        self.assertEquals(step.total_units, 2)
开发者ID:hgschmie,项目名称:pulp,代码行数:13,代码来源:test_publish_step.py


示例5: test_process_step_single_unit_exception

    def test_process_step_single_unit_exception(self, mock_get_units):
        self.publisher.repo.content_unit_counts = {'FOO_TYPE': 1}
        mock_method = Mock(side_effect=Exception())
        mock_get_units.return_value = ['mock_unit']
        step = UnitPublishStep('foo_step', 'FOO_TYPE')
        step.parent = self.publisher
        step.process_unit = mock_method

        self.assertRaises(Exception, step.process)
        self.assertEquals(step.state, reporting_constants.STATE_FAILED)
        self.assertEquals(step.progress_successes, 0)
        self.assertEquals(step.progress_failures, 1)
        self.assertEquals(step.total_units, 1)
        mock_method.assert_called_once_with('mock_unit')
开发者ID:hgschmie,项目名称:pulp,代码行数:14,代码来源:test_publish_step.py


示例6: test_process_step_single_unit

    def test_process_step_single_unit(self, mock_get_units):
        self.publisher.repo.content_unit_counts = {'FOO_TYPE': 1}
        mock_method = Mock()
        mock_get_units.return_value = ['mock_unit']
        step = UnitPublishStep('foo_step', 'FOO_TYPE')
        step.parent = self.publisher
        step.process_unit = mock_method
        step.process()

        self.assertEquals(step.state, reporting_constants.STATE_COMPLETE)
        self.assertEquals(step.progress_successes, 1)
        self.assertEquals(step.progress_failures, 0)
        self.assertEquals(step.total_units, 1)
        mock_method.assert_called_once_with('mock_unit')
开发者ID:hgschmie,项目名称:pulp,代码行数:14,代码来源:test_publish_step.py


示例7: test_process_unit_with_no_work

 def test_process_unit_with_no_work(self):
     # Run the blank process unit to ensure no exceptions are raised
     step = UnitPublishStep("foo", ['bar', 'baz'])
     step.process_unit('foo')
开发者ID:hgschmie,项目名称:pulp,代码行数:4,代码来源:test_publish_step.py


示例8: test_get_total_for_none

 def test_get_total_for_none(self):
     step = UnitPublishStep("foo", ['bar', 'baz'])
     step.parent = Mock()
     step.parent.repo.content_unit_counts.get.return_value = 0
     total = step._get_total()
     self.assertEquals(0, total)
开发者ID:hgschmie,项目名称:pulp,代码行数:6,代码来源:test_publish_step.py


示例9: test_is_skipped_dict_not_skipped

 def test_is_skipped_dict_not_skipped(self):
     step = UnitPublishStep("foo", 'bar')
     step.config = PluginCallConfiguration(None, None)
     self.assertFalse(step.is_skipped())
开发者ID:hgschmie,项目名称:pulp,代码行数:4,代码来源:test_publish_step.py


示例10: test_is_skipped_dict

 def test_is_skipped_dict(self):
     step = UnitPublishStep("foo", 'bar')
     step.config = PluginCallConfiguration(None, {'skip': {'bar': True, 'baz': True}})
     self.assertTrue(step.is_skipped())
开发者ID:hgschmie,项目名称:pulp,代码行数:4,代码来源:test_publish_step.py


示例11: test_process_step_skip_units

 def test_process_step_skip_units(self):
     self.publisher.config = PluginCallConfiguration(None, {'skip': ['FOO']})
     step = UnitPublishStep('foo_step', 'FOO')
     step.parent = self.publisher
     step.process()
     self.assertEquals(step.state, reporting_constants.STATE_SKIPPED)
开发者ID:hgschmie,项目名称:pulp,代码行数:6,代码来源:test_publish_step.py


示例12: test_get_with_association_filter

 def test_get_with_association_filter(self):
     step = UnitPublishStep("foo", ['bar', 'baz'])
     step.association_filters = {'foo': 'bar'}
     total = step._get_total()
     self.assertEquals(1, total)
开发者ID:aweiteka,项目名称:pulp,代码行数:5,代码来源:test_publish_step.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python verification.sanitize_checksum_type函数代码示例发布时间:2022-05-25
下一篇:
Python publish_step.PublishStep类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap