Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgtaylor committed Feb 10, 2015
1 parent 0d05270 commit aaab03e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/integration/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,29 @@ def test_can_create_object_directly(self):

self.assertEqual(obj.bucket_name, self.bucket_name)
self.assertEqual(obj.key, 'test.txt')

def test_s3_multipart(self):
# Create the bucket
bucket = self.create_bucket_resource(self.bucket_name)
bucket.wait_until_exists()

# Create the multipart upload
mpu = bucket.Object('mp-test.txt').initiate_multipart_upload()
self.addCleanup(mpu.abort)

# Create and upload a part
part = mpu.Part(1)
response = part.upload(b'hello, world!')

# Complete the upload, which requires info on all of the parts
part_info = {
'Parts': [
{
'PartNumber': 1,
'ETag': response['ETag']
}
]
}

mpu.complete(MultipartUpload=part_info)
self.addCleanup(bucket.Object('mp-test.txt').delete)

0 comments on commit aaab03e

Please sign in to comment.