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


Python OrphanManager.unlink_shared方法代码示例

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


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

示例1: test_delete_links_not_empty

# 需要导入模块: from pulp.server.managers.content.orphan import OrphanManager [as 别名]
# 或者: from pulp.server.managers.content.orphan.OrphanManager import unlink_shared [as 别名]
    def test_delete_links_not_empty(self, delete, read_link, listdir):
        path = '/parent/links/path-1'
        content = '/parent/content'
        read_link.return_value = content
        listdir.return_value = ['link-2']

        # test
        OrphanManager.unlink_shared(path)

        # validation
        read_link.assert_called_once_with(path)
        listdir.assert_called_once_with(os.path.dirname(path))
        delete.assert_called_once_with(path)
开发者ID:pulp,项目名称:pulp,代码行数:15,代码来源:test_orphan.py

示例2: test_delete_target_not_sibling

# 需要导入模块: from pulp.server.managers.content.orphan import OrphanManager [as 别名]
# 或者: from pulp.server.managers.content.orphan.OrphanManager import unlink_shared [as 别名]
    def test_delete_target_not_sibling(self, delete, read_link, listdir):
        path = '/parent/links/path-1'
        content = '/NOT-SAME-PARENT/content'
        read_link.return_value = content
        listdir.return_value = []

        # test
        OrphanManager.unlink_shared(path)

        # validation
        read_link.assert_called_once_with(path)
        listdir.assert_called_once_with(os.path.dirname(path))
        delete.assert_called_once_with(path)
开发者ID:pulp,项目名称:pulp,代码行数:15,代码来源:test_orphan.py

示例3: test_delete_all

# 需要导入模块: from pulp.server.managers.content.orphan import OrphanManager [as 别名]
# 或者: from pulp.server.managers.content.orphan.OrphanManager import unlink_shared [as 别名]
    def test_delete_all(self, delete, read_link, listdir):
        path = '/parent/links/path-1'
        content = '/parent/content'
        read_link.return_value = content
        listdir.return_value = []

        # test
        OrphanManager.unlink_shared(path)

        # validation
        read_link.assert_called_once_with(path)
        listdir.assert_called_once_with(os.path.dirname(path))
        self.assertEqual(
            delete.call_args_list,
            [
                ((path,), {}),
                ((content,), {}),
            ])
开发者ID:pulp,项目名称:pulp,代码行数:20,代码来源:test_orphan.py


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