From 32395e47f91b503f61aef592f26b2c4370b52938 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 24 Apr 2023 20:49:41 +0530 Subject: [PATCH] Added duplicate flags test for prune Signed-off-by: Chirag Aggarwal --- tests/integration/borg/test_commands.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration/borg/test_commands.py b/tests/integration/borg/test_commands.py index 1afb0e0f..6049a263 100644 --- a/tests/integration/borg/test_commands.py +++ b/tests/integration/borg/test_commands.py @@ -106,3 +106,17 @@ def test_display_archives_info_command_does_not_duplicate_flags_or_raise(): borgmatic.borg.info.display_archives_info( 'repo', {}, '2.3.4', fuzz_argument(arguments, argument_name) ) + +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) + )