Validates that the progress chunks align with our chunking procedure.
(self, size, max_chunk_size, progress, unknown_size=False)
| 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.''' |
no outgoing calls
no test coverage detected