Add test for prune_split when no archives exist

This commit is contained in:
Alf Mikula 2021-10-27 15:52:45 -07:00
parent 9b6adc1cd6
commit 5b050bd01c
1 changed files with 13 additions and 0 deletions

View File

@ -439,6 +439,19 @@ def test_prune_split_keep_oldest():
assert kept_because[4][0] == "yearly" assert kept_because[4][0] == "yearly"
def test_prune_split_no_archives():
def subset(lst, ids):
return {i for i in lst if i.id in ids}
archives = []
kept_because = {}
keep = prune_split(archives, "yearly", 3, kept_because)
assert keep == []
assert kept_because == {}
class IntervalTestCase(BaseTestCase): class IntervalTestCase(BaseTestCase):
def test_interval(self): def test_interval(self):
self.assert_equal(interval('1H'), 1) self.assert_equal(interval('1H'), 1)