Add additional Swift chunking tests

This commit is contained in:
Joseph Schorr 2017-11-28 09:31:40 +02:00
parent 773ea9fc65
commit 3bbcb93977
2 changed files with 33 additions and 14 deletions

View file

@ -266,8 +266,8 @@ class SwiftStorage(BaseStorage):
if length == 0:
return 0, storage_metadata, None
# Note: Swift limits segments to a maximum of 5GB, so we keep writing segments until we
# are finished hitting the data limit.
# Note: Swift limits segments in size, so we need to sub-divide chunks into segments
# based on the configured maximum.
total_bytes_written = 0
upload_error = None
read_until_end = length == filelike.READ_UNTIL_END
@ -289,6 +289,7 @@ class SwiftStorage(BaseStorage):
offset = offset + bytes_written
total_bytes_written = total_bytes_written + bytes_written
if bytes_written == 0 or (not read_until_end and length <= 0):
return total_bytes_written, storage_metadata, upload_error