coverage
This commit is contained in:
@ -36,6 +36,9 @@ class TestThinner(unittest2.TestCase):
|
||||
with self.assertRaisesRegexp(Exception, "^Invalid schedule"):
|
||||
ThinnerRule("XXX")
|
||||
|
||||
with self.assertRaisesRegexp(Exception, "^Number of"):
|
||||
Thinner("-1")
|
||||
|
||||
|
||||
def test_incremental(self):
|
||||
ok=['2023-01-03 10:53:16',
|
||||
|
||||
@ -19,7 +19,7 @@ class Thinner:
|
||||
|
||||
rule_strs = schedule_str.split(",")
|
||||
for rule_str in rule_strs:
|
||||
if rule_str.isdigit():
|
||||
if rule_str.lstrip('-').isdigit():
|
||||
self.always_keep = int(rule_str)
|
||||
if self.always_keep < 0:
|
||||
raise (Exception("Number of snapshots to keep cant be negative: {}".format(self.always_keep)))
|
||||
|
||||
Reference in New Issue
Block a user