From 9299841a5b22028899057f167e8f4e7cd67cc7e1 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 23 May 2023 14:30:16 -0700 Subject: [PATCH] Add date-based matching flags to NEWS (#659). --- NEWS | 1 + tests/integration/borg/test_commands.py | 42 ++++++++++++------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/NEWS b/NEWS index 9308507..85bfa38 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ 1.7.14.dev0 * #688: Tweak archive check probing logic to use the newest timestamp found when multiple exist. + * #659: Add Borg 2 date-based matching flags to various actions for archive selection. 1.7.13 * #375: Restore particular PostgreSQL schemas from a database dump via "borgmatic restore --schema" diff --git a/tests/integration/borg/test_commands.py b/tests/integration/borg/test_commands.py index 3347890..11fbe98 100644 --- a/tests/integration/borg/test_commands.py +++ b/tests/integration/borg/test_commands.py @@ -68,6 +68,27 @@ def test_transfer_archives_command_does_not_duplicate_flags_or_raise(): ) +def test_prune_archives_command_does_not_duplicate_flags_or_raise(): + arguments = borgmatic.commands.arguments.parse_arguments('prune')['prune'] + flexmock(borgmatic.borg.prune).should_receive('execute_command').replace_with( + assert_command_does_not_duplicate_flags + ) + + for argument_name in dir(arguments): + if argument_name.startswith('_'): + continue + + borgmatic.borg.prune.prune_archives( + False, + 'repo', + {}, + {}, + '2.3.4', + fuzz_argument(arguments, argument_name), + argparse.Namespace(log_json=False), + ) + + def test_make_list_command_does_not_duplicate_flags_or_raise(): arguments = borgmatic.commands.arguments.parse_arguments('list')['list'] @@ -124,24 +145,3 @@ def test_display_archives_info_command_does_not_duplicate_flags_or_raise(): fuzz_argument(arguments, argument_name), argparse.Namespace(log_json=False), ) - - -def test_prune_archives_command_does_not_duplicate_flags_or_raise(): - arguments = borgmatic.commands.arguments.parse_arguments('prune')['prune'] - flexmock(borgmatic.borg.prune).should_receive('execute_command').replace_with( - assert_command_does_not_duplicate_flags - ) - - for argument_name in dir(arguments): - if argument_name.startswith('_'): - continue - - borgmatic.borg.prune.prune_archives( - False, - 'repo', - {}, - {}, - '2.3.4', - fuzz_argument(arguments, argument_name), - argparse.Namespace(log_json=False), - )