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


Python UnitPublishStep.association_filters方法代码示例

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


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

示例1: test_get_total_ignore_filter

# 需要导入模块: from pulp.plugins.util.publish_step import UnitPublishStep [as 别名]
# 或者: from pulp.plugins.util.publish_step.UnitPublishStep import association_filters [as 别名]
 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,代码行数:9,代码来源:test_publish_step.py

示例2: test_get_with_association_filter

# 需要导入模块: from pulp.plugins.util.publish_step import UnitPublishStep [as 别名]
# 或者: from pulp.plugins.util.publish_step.UnitPublishStep import association_filters [as 别名]
    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,代码行数:14,代码来源:test_publish_step.py

示例3: test_get_with_association_filter

# 需要导入模块: from pulp.plugins.util.publish_step import UnitPublishStep [as 别名]
# 或者: from pulp.plugins.util.publish_step.UnitPublishStep import association_filters [as 别名]
 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,代码行数:7,代码来源:test_publish_step.py


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