mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 01:37:20 +00:00
Merge pull request #2460 from ThomasWaldmann/benchmark-minor-fix
fix invalid param issue in benchmarks
This commit is contained in:
commit
cb67d1359e
1 changed files with 3 additions and 1 deletions
|
@ -40,9 +40,11 @@ def testdata(request, tmpdir_factory):
|
||||||
# do not use a binary zero (\0) to avoid sparse detection
|
# do not use a binary zero (\0) to avoid sparse detection
|
||||||
def data(size):
|
def data(size):
|
||||||
return b'0' * size
|
return b'0' * size
|
||||||
if data_type == 'random':
|
elif data_type == 'random':
|
||||||
def data(size):
|
def data(size):
|
||||||
return os.urandom(size)
|
return os.urandom(size)
|
||||||
|
else:
|
||||||
|
raise ValueError("data_type must be 'random' or 'zeros'.")
|
||||||
for i in range(count):
|
for i in range(count):
|
||||||
with open(str(p.join(str(i))), "wb") as f:
|
with open(str(p.join(str(i))), "wb") as f:
|
||||||
f.write(data(size))
|
f.write(data(size))
|
||||||
|
|
Loading…
Reference in a new issue