mirror of
https://github.com/ceph/s3-tests.git
synced 2025-05-13 05:18:16 +00:00
Correctly generate non-mod 1024 parts in generator
Also move implementation to utils and add unit tests.
This commit is contained in:
parent
4a67f6c0f3
commit
ca2c0dc283
3 changed files with 33 additions and 20 deletions
11
s3tests/functional/test_utils.py
Normal file
11
s3tests/functional/test_utils.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
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)
|
Loading…
Add table
Add a link
Reference in a new issue