From 620bf52e0106ace6ec402f972ca58198c3261222 Mon Sep 17 00:00:00 2001 From: Vandal <86826719+VandalByte@users.noreply.github.com> Date: Sun, 20 Apr 2025 09:31:51 +0530 Subject: [PATCH] add prune test --- tests/unit/borg/test_prune.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/unit/borg/test_prune.py b/tests/unit/borg/test_prune.py index fbf4f16c..60323e78 100644 --- a/tests/unit/borg/test_prune.py +++ b/tests/unit/borg/test_prune.py @@ -43,6 +43,28 @@ def test_make_prune_flags_returns_flags_from_config(): assert result == BASE_PRUNE_FLAGS +def test_make_prune_flags_with_keep_13weekly_and_keep_3monthly(): + config = { + 'keep_13weekly': 4, + 'keep_3monthly': 5, + } + flexmock(module.feature).should_receive('available').and_return(True) + flexmock(module.flags).should_receive('make_match_archives_flags').and_return(()) + + result = module.make_prune_flags( + config, flexmock(match_archives=None), local_borg_version='1.2.3' + ) + + expected = ( + '--keep-13weekly', + '4', + '--keep-3monthly', + '5', + ) + + assert result == expected + + def test_make_prune_flags_accepts_prefix_with_placeholders(): config = { 'keep_daily': 1,