| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| from unittest import TestCase |
|
|
| from nose.tools import eq_ |
|
|
| from minio.definitions import Part |
| from minio.xml_marshal import marshal_complete_multipart |
|
|
|
|
| class GenerateRequestTest(TestCase): |
| def test_generate_complete_multipart_upload(self): |
| expected_string = (b'<CompleteMultipartUpload ' |
| b'xmlns="http://s3.amazonaws.com/doc/2006-03-01/">' |
| b'<Part><PartNumber>1</PartNumber>' |
| b'<ETag>"a54357aff0632cce46d942af68356b38"</ETag>' |
| b'</Part>' |
| b'<Part><PartNumber>2</PartNumber>' |
| b'<ETag>"0c78aef83f66abc1fa1e8477f296d394"</ETag>' |
| b'</Part>' |
| b'<Part><PartNumber>3</PartNumber>' |
| b'<ETag>"acbd18db4cc2f85cedef654fccc4a4d8"</ETag>' |
| b'</Part>' |
| b'</CompleteMultipartUpload>') |
|
|
| etags = [ |
| Part(1, 'a54357aff0632cce46d942af68356b38'), |
| Part(2, '0c78aef83f66abc1fa1e8477f296d394'), |
| Part(3, 'acbd18db4cc2f85cedef654fccc4a4d8'), |
| ] |
| actual_string = marshal_complete_multipart(etags) |
| eq_(expected_string, actual_string) |
|
|