mirror of https://github.com/borgbackup/borg.git
Merge pull request #3935 from ThomasWaldmann/less-random
tests: fetch less data via os.urandom
This commit is contained in:
commit
485aedca43
|
@ -45,9 +45,11 @@ def test_lz4():
|
||||||
|
|
||||||
def test_lz4_buffer_allocation():
|
def test_lz4_buffer_allocation():
|
||||||
# test with a rather huge data object to see if buffer allocation / resizing works
|
# test with a rather huge data object to see if buffer allocation / resizing works
|
||||||
data = os.urandom(50 * 2**20) # 50MiB incompressible data
|
data = os.urandom(5 * 2**20) * 10 # 50MiB badly compressible data
|
||||||
|
assert len(data) == 50 * 2**20
|
||||||
c = get_compressor(name='lz4')
|
c = get_compressor(name='lz4')
|
||||||
cdata = c.compress(data)
|
cdata = c.compress(data)
|
||||||
|
assert len(cdata) > len(data)
|
||||||
assert data == c.decompress(cdata)
|
assert data == c.decompress(cdata)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue