transfer_test_5.py 498 B

123456789101112
  1. def testComputeEndByteNoTotal(self):
  2. download = transfer.Download.FromStream(six.StringIO())
  3. default_chunksize = download.chunksize
  4. for chunksize in (100, default_chunksize):
  5. download.chunksize = chunksize
  6. for start in (0, 10):
  7. self.assertEqual(
  8. download.chunksize + start - 1,
  9. download._Download__ComputeEndByte(start),
  10. msg='Failed on start={0}, chunksize={1}'.format(
  11. start, chunksize))