本文整理汇总了Python中synapseclient.File.synapseStore方法的典型用法代码示例。如果您正苦于以下问题:Python File.synapseStore方法的具体用法?Python File.synapseStore怎么用?Python File.synapseStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类synapseclient.File
的用法示例。
在下文中一共展示了File.synapseStore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_download_file_URL_false
# 需要导入模块: from synapseclient import File [as 别名]
# 或者: from synapseclient.File import synapseStore [as 别名]
def test_download_file_URL_false():
# Upload an external file handle
fileThatExists = 'http://dev-versions.synapse.sagebase.org/synapsePythonClient'
reupload = File(fileThatExists, synapseStore=False, parent=project)
reupload = syn.store(reupload)
reupload = syn.get(reupload, downloadFile=False)
originalVersion = reupload.versionNumber
# Reupload and check that the URL and version does not get mangled
reupload = syn.store(reupload, forceVersion=False)
assert reupload.path == fileThatExists, "Entity should still be pointing at a URL"
assert originalVersion == reupload.versionNumber
# Try a URL with an extra slash at the end
fileThatDoesntExist = 'http://dev-versions.synapse.sagebase.org/synapsePythonClient/'
reupload.synapseStore = False
reupload.path = fileThatDoesntExist
reupload = syn.store(reupload)
reupload = syn.get(reupload, downloadFile=False)
originalVersion = reupload.versionNumber
reupload = syn.store(reupload, forceVersion=False)
assert reupload.path == fileThatDoesntExist, "Entity should still be pointing at a URL"
assert originalVersion == reupload.versionNumber