Correct size check on multipart uploads. All parts except last must be > 5MB

This commit is contained in:
Mike Attili 2013-11-07 17:09:53 -05:00
parent b64dbcaa12
commit d9862aaa65

View File

@ -60,16 +60,15 @@ class FakeMultipart(object):
self.parts = {}
self.id = base64.b64encode(os.urandom(43)).replace('=', '').replace('+', '')
def complete(self):
total = bytearray()
last_part_name = len(self.list_parts())
for part in self.list_parts():
if part.name != last_part_name and len(part.value) < 5242880:
return
total.extend(part.value)
if len(total) < 5242880:
return
return total
def set_part(self, part_id, value):