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


Python ContentContainer.purge_orphans方法代码示例

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


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

示例1: test_purge_orphans

# 需要导入模块: from pulp.server.content.sources.container import ContentContainer [as 别名]
# 或者: from pulp.server.content.sources.container.ContentContainer import purge_orphans [as 别名]
    def test_purge_orphans(self, fake_manager, fake_load):
        fake_load.return_value = {"A": 1, "B": 2, "C": 3}

        # test
        container = ContentContainer("")

        # validation
        container.purge_orphans()

        fake_manager().purge_orphans.assert_called_with(fake_load.return_value.keys())
开发者ID:maxamillion,项目名称:pulp,代码行数:12,代码来源:test_container.py

示例2: test_purge_orphans

# 需要导入模块: from pulp.server.content.sources.container import ContentContainer [as 别名]
# 或者: from pulp.server.content.sources.container.ContentContainer import purge_orphans [as 别名]
    def test_purge_orphans(self, fake_manager, fake_load):
        fake_load.return_value = {'A': 1, 'B': 2, 'C': 3}

        # test
        container = ContentContainer('')

        # validation
        container.purge_orphans()

        fake_manager().purge_orphans.assert_called_with(fake_load.return_value.keys())
开发者ID:aweiteka,项目名称:pulp,代码行数:12,代码来源:test_container.py

示例3: test_purge_orphans

# 需要导入模块: from pulp.server.content.sources.container import ContentContainer [as 别名]
# 或者: from pulp.server.content.sources.container.ContentContainer import purge_orphans [as 别名]
    def test_purge_orphans(self):
        _dir, cataloged = self.populate_catalog(ORPHANED, 0, 10)
        _dir, cataloged = self.populate_catalog(UNDERGROUND, 0, 10)
        _dir, cataloged = self.populate_catalog(UNIT_WORLD, 0, 10)
        collection = ContentCatalog.get_collection()
        self.assertEqual(collection.find().count(), 30)
        container = ContentContainer(path=self.tmp_dir)

        # test
        container.purge_orphans()

        # validation
        self.assertEqual(collection.find().count(), 20)
        self.assertEqual(collection.find({'source_id': ORPHANED}).count(), 0)
        self.assertEqual(collection.find({'source_id': UNDERGROUND}).count(), 10)
        self.assertEqual(collection.find({'source_id': UNIT_WORLD}).count(), 10)
开发者ID:alanoe,项目名称:pulp,代码行数:18,代码来源:test_content_sources.py


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