本文整理汇总了Python中synapseclient.File.name方法的典型用法代码示例。如果您正苦于以下问题:Python File.name方法的具体用法?Python File.name怎么用?Python File.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类synapseclient.File
的用法示例。
在下文中一共展示了File.name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_download_file_false
# 需要导入模块: from synapseclient import File [as 别名]
# 或者: from synapseclient.File import name [as 别名]
def test_download_file_false():
RENAME_SUFFIX = 'blah'
# Upload a file
filepath = utils.make_bogus_binary_file()
schedule_for_cleanup(filepath)
schedule_for_cleanup(filepath + RENAME_SUFFIX)
file = File(filepath, name='SYNR 619', parent=project)
file = syn.store(file)
# Now hide the file from the cache and download with downloadFile=False
os.rename(filepath, filepath + RENAME_SUFFIX)
file = syn.get(file.id, downloadFile=False)
# Change something and reupload the file's metadata
file.name = "Only change the name, not the file"
reupload = syn.store(file)
assert reupload.path is None, "Path field should be null: %s" % reupload.path
# This should still get the correct file
reupload = syn.get(reupload.id)
assert filecmp.cmp(filepath + RENAME_SUFFIX, reupload.path)
assert reupload.name == file.name