2014-12-23 02:19:44 +00:00
|
|
|
from nose.tools import eq_ as eq
|
|
|
|
|
2019-03-22 17:58:30 +00:00
|
|
|
from . import utils
|
2014-12-23 02:19:44 +00:00
|
|
|
|
|
|
|
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)
|