本文整理汇总了Python中sword2.Connection.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Connection.delete方法的具体用法?Python Connection.delete怎么用?Python Connection.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sword2.Connection
的用法示例。
在下文中一共展示了Connection.delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_22_Create_deposit_and_delete_deposit
# 需要导入模块: from sword2 import Connection [as 别名]
# 或者: from sword2.Connection import delete [as 别名]
def test_22_Create_deposit_and_delete_deposit(self):
conn = Connection("http://localhost:%s/sd-uri" % PORT_NUMBER, user_name="sword", user_pass="sword", download_service_document=True)
e = Entry(title="Foo", id="asidjasidj", dcterms_appendix="blah blah", dcterms_title="foo bar")
deposit_receipt = conn.create(payload = "Multipart_POST_then_update_on_EM_IRI",
metadata_entry = e,
mimetype = "text/plain",
filename = "readme.txt",
packaging = 'http://purl.org/net/sword/package/Binary',
col_iri = conn.sd.workspaces[0][1][0].href,
in_progress=True)
assert deposit_receipt.edit != None
dr = conn.delete(resource_iri = deposit_receipt.edit)
assert dr.code == 204 or dr.code == 200