本文整理汇总了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)
示例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)
示例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)