本文整理汇总了Python中addons.osfstorage.models.OsfStorageFileNode.get_file_guids方法的典型用法代码示例。如果您正苦于以下问题:Python OsfStorageFileNode.get_file_guids方法的具体用法?Python OsfStorageFileNode.get_file_guids怎么用?Python OsfStorageFileNode.get_file_guids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addons.osfstorage.models.OsfStorageFileNode
的用法示例。
在下文中一共展示了OsfStorageFileNode.get_file_guids方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_file_guids_trashed_file_wo_guid
# 需要导入模块: from addons.osfstorage.models import OsfStorageFileNode [as 别名]
# 或者: from addons.osfstorage.models.OsfStorageFileNode import get_file_guids [as 别名]
def test_get_file_guids_trashed_file_wo_guid(self):
node = self.node_settings.owner
file = OsfStorageFile(name='foo', node=node)
file.save()
file.delete()
assert [] == OsfStorageFileNode.get_file_guids(
'/' + file._id, provider='osfstorage', node=node)
示例2: test_get_file_guids_for_live_file
# 需要导入模块: from addons.osfstorage.models import OsfStorageFileNode [as 别名]
# 或者: from addons.osfstorage.models.OsfStorageFileNode import get_file_guids [as 别名]
def test_get_file_guids_for_live_file(self):
node = self.node_settings.owner
file = OsfStorageFile(name='foo', node=node)
file.save()
file.get_guid(create=True)
guid = file.get_guid()._id
assert guid is not None
assert guid in OsfStorageFileNode.get_file_guids(
'/' + file._id, provider='osfstorage', node=node)
示例3: test_get_file_guids_for_live_folder_wo_guids
# 需要导入模块: from addons.osfstorage.models import OsfStorageFileNode [as 别名]
# 或者: from addons.osfstorage.models.OsfStorageFileNode import get_file_guids [as 别名]
def test_get_file_guids_for_live_folder_wo_guids(self):
node = self.node_settings.owner
folder = OsfStorageFolder(name='foofolder', node=node)
folder.save()
files = []
for i in range(1, 4):
files.append(folder.append_file('foo.{}'.format(i)))
all_guids = OsfStorageFileNode.get_file_guids(
'/' + folder._id, provider='osfstorage', node=node)
assert [] == all_guids
示例4: test_get_file_guids_for_live_folder
# 需要导入模块: from addons.osfstorage.models import OsfStorageFileNode [as 别名]
# 或者: from addons.osfstorage.models.OsfStorageFileNode import get_file_guids [as 别名]
def test_get_file_guids_for_live_folder(self):
node = self.node_settings.owner
folder = OsfStorageFolder(name='foofolder', node=node)
folder.save()
files = []
for i in range(1, 4):
files.append(folder.append_file('foo.{}'.format(i)))
files[-1].get_guid(create=True)
guids = [file.get_guid()._id for file in files]
assert len(guids) == len(files)
all_guids = OsfStorageFileNode.get_file_guids(
'/' + folder._id, provider='osfstorage', node=node)
assert sorted(guids) == sorted(all_guids)
示例5: test_get_file_guids_for_trashed_folder_recursive_wo_guids
# 需要导入模块: from addons.osfstorage.models import OsfStorageFileNode [as 别名]
# 或者: from addons.osfstorage.models.OsfStorageFileNode import get_file_guids [as 别名]
def test_get_file_guids_for_trashed_folder_recursive_wo_guids(self):
node = self.node_settings.owner
folder = OsfStorageFolder(name='foofolder', target=node)
folder.save()
files = []
for i in range(1, 4):
files.append(folder.append_file('foo.{}'.format(i)))
subfolder = folder.append_folder('subfoo')
for i in range(1, 4):
files.append(subfolder.append_file('subfoo.{}'.format(i)))
folder.delete()
all_guids = OsfStorageFileNode.get_file_guids(
'/' + folder._id, provider='osfstorage', target=node)
assert [] == all_guids