本文整理汇总了Python中minio.Minio._list_incomplete_uploads方法的典型用法代码示例。如果您正苦于以下问题:Python Minio._list_incomplete_uploads方法的具体用法?Python Minio._list_incomplete_uploads怎么用?Python Minio._list_incomplete_uploads使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类minio.Minio
的用法示例。
在下文中一共展示了Minio._list_incomplete_uploads方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_empty_list_uploads_test
# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import _list_incomplete_uploads [as 别名]
def test_empty_list_uploads_test(self, mock_connection):
mock_data = '''<?xml version="1.0"?>
<ListMultipartUploadsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Bucket>golang</Bucket>
<KeyMarker/>
<UploadIdMarker/>
<NextKeyMarker/>
<NextUploadIdMarker/>
<EncodingType/>
<MaxUploads>1000</MaxUploads>
<IsTruncated>false</IsTruncated>
<Prefix/>
<Delimiter/>
</ListMultipartUploadsResult>
'''
mock_server = MockConnection()
mock_connection.return_value = mock_server
mock_server.mock_add_request(
MockResponse('GET',
'https://localhost:9000/bucket/?max-uploads=1000&uploads',
{'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data))
client = Minio('localhost:9000')
upload_iter = client._list_incomplete_uploads('bucket', '', True, False)
uploads = []
for upload in upload_iter:
uploads.append(upload)
eq_(0, len(uploads))
示例2: test_list_uploads_works
# 需要导入模块: from minio import Minio [as 别名]
# 或者: from minio.Minio import _list_incomplete_uploads [as 别名]
def test_list_uploads_works(self, mock_connection):
mock_data = '''<?xml version="1.0"?>
<ListMultipartUploadsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Bucket>golang</Bucket>
<KeyMarker/>
<UploadIdMarker/>
<NextKeyMarker>keymarker</NextKeyMarker>
<NextUploadIdMarker>uploadidmarker</NextUploadIdMarker>
<EncodingType/>
<MaxUploads>1000</MaxUploads>
<IsTruncated>false</IsTruncated>
<Upload>
<Key>go1.4.2</Key>
<UploadId>uploadid</UploadId>
<Initiator>
<ID/>
<DisplayName/>
</Initiator>
<Owner>
<ID/>
<DisplayName/>
</Owner>
<StorageClass/>
<Initiated>2015-05-30T14:43:35.349Z</Initiated>
</Upload>
<Upload>
<Key>go1.5.0</Key>
<UploadId>uploadid2</UploadId>
<Initiator>
<ID/>
<DisplayName/>
</Initiator>
<Owner>
<ID/>
<DisplayName/>
</Owner>
<StorageClass/>
<Initiated>2015-05-30T15:00:07.759Z</Initiated>
</Upload>
<Prefix/>
<Delimiter/>
</ListMultipartUploadsResult>
'''
mock_server = MockConnection()
mock_connection.return_value = mock_server
mock_server.mock_add_request(
MockResponse('GET',
'https://localhost:9000/bucket/?delimiter=%2F&max-uploads=1000&uploads',
{'User-Agent': _DEFAULT_USER_AGENT},
200, content=mock_data))
client = Minio('localhost:9000')
upload_iter = client._list_incomplete_uploads('bucket', '', False, False)
uploads = []
for upload in upload_iter:
uploads.append(upload)
eq_(2, len(uploads))