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