s3-tests/s3tests/functional/test_utils.py
Andrew Gaul ca2c0dc283 Correctly generate non-mod 1024 parts in generator
Also move implementation to utils and add unit tests.
2014-12-22 20:16:25 -08:00

11 lines
401 B
Python

from nose.tools import eq_ as eq
import utils
def test_generate():
FIVE_MB = 5 * 1024 * 1024
eq(len(''.join(utils.generate_random(0))), 0)
eq(len(''.join(utils.generate_random(1))), 1)
eq(len(''.join(utils.generate_random(FIVE_MB - 1))), FIVE_MB - 1)
eq(len(''.join(utils.generate_random(FIVE_MB))), FIVE_MB)
eq(len(''.join(utils.generate_random(FIVE_MB + 1))), FIVE_MB + 1)