当前位置: 首页>>代码示例>>Python>>正文


Python Minio._list_incomplete_uploads方法代码示例

本文整理汇总了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))
开发者ID:bacongobbler,项目名称:minio-py,代码行数:29,代码来源:list_incomplete_uploads_test.py

示例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))
开发者ID:bacongobbler,项目名称:minio-py,代码行数:59,代码来源:list_incomplete_uploads_test.py


注:本文中的minio.Minio._list_incomplete_uploads方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。