From d949d6bc7cfa10099fe53d5ea20259bebf08225d Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 29 Apr 2017 03:00:59 +0200 Subject: [PATCH] fix invalid param issue in benchmarks fixes CID1431887 --- src/borg/testsuite/benchmark.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/borg/testsuite/benchmark.py b/src/borg/testsuite/benchmark.py index b3400c2f9..dcc71b011 100644 --- a/src/borg/testsuite/benchmark.py +++ b/src/borg/testsuite/benchmark.py @@ -40,9 +40,11 @@ def testdata(request, tmpdir_factory): # do not use a binary zero (\0) to avoid sparse detection def data(size): return b'0' * size - if data_type == 'random': + elif data_type == 'random': def data(size): return os.urandom(size) + else: + raise ValueError("data_type must be 'random' or 'zeros'.") for i in range(count): with open(str(p.join(str(i))), "wb") as f: f.write(data(size))