MCPcopy Create free account
hub / github.com/Azure/azure-storage-python / assert_upload_progress

Method assert_upload_progress

tests/testcase.py:345–353  ·  view source on GitHub ↗

Validates that the progress chunks align with our chunking procedure.

(self, size, max_chunk_size, progress, unknown_size=False)

Source from the content-addressed store, hash-verified

343 return val
344
345 def assert_upload_progress(self, size, max_chunk_size, progress, unknown_size=False):
346 '''Validates that the progress chunks align with our chunking procedure.'''
347 index = 0
348 total = None if unknown_size else size
349 small_chunk_size = size % max_chunk_size
350 self.assertEqual(len(progress), 1 + math.ceil(size / max_chunk_size))
351 for i in progress:
352 self.assertTrue(i[0] % max_chunk_size == 0 or i[0] % max_chunk_size == small_chunk_size)
353 self.assertEqual(i[1], total)
354
355 def assert_download_progress(self, size, max_chunk_size, max_get_size, progress, single_download=False):
356 '''Validates that the progress chunks align with our chunking procedure.'''

Calls

no outgoing calls

Tested by

no test coverage detected