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


Python OrphanManager.delete方法代码示例

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


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

示例1: test_delete_exception

# 需要导入模块: from pulp.server.managers.content.orphan import OrphanManager [as 别名]
# 或者: from pulp.server.managers.content.orphan.OrphanManager import delete [as 别名]
    def test_delete_exception(self, is_dir, unlink, log_error):
        path = 'path-1'
        is_dir.return_value = False
        unlink.side_effect = OSError

        # test
        OrphanManager.delete(path)

        # validation
        self.assertTrue(log_error.called)
开发者ID:pulp,项目名称:pulp,代码行数:12,代码来源:test_orphan.py

示例2: test_delete_file

# 需要导入模块: from pulp.server.managers.content.orphan import OrphanManager [as 别名]
# 或者: from pulp.server.managers.content.orphan.OrphanManager import delete [as 别名]
    def test_delete_file(self, is_file, unlink, rmtree):
        path = 'path-1'
        is_file.return_value = True

        # test
        OrphanManager.delete(path)

        # validation
        is_file.assert_called_with(path)
        unlink.assert_called_with(path)
        self.assertFalse(rmtree.called)
开发者ID:pulp,项目名称:pulp,代码行数:13,代码来源:test_orphan.py

示例3: test_delete_dir

# 需要导入模块: from pulp.server.managers.content.orphan import OrphanManager [as 别名]
# 或者: from pulp.server.managers.content.orphan.OrphanManager import delete [as 别名]
    def test_delete_dir(self, is_file, is_link, unlink, rmtree):
        path = 'path-1'
        is_file.return_value = False
        is_link.return_value = False

        # test
        OrphanManager.delete(path)

        # validation
        is_file.assert_called_with(path)
        is_link.assert_called_with(path)
        rmtree.assert_called_with(path)
        self.assertFalse(unlink.called)
开发者ID:pulp,项目名称:pulp,代码行数:15,代码来源:test_orphan.py


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