From 76138faaf385a27563dc5271c03eef3e90c83a97 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 23 May 2023 14:49:04 -0700 Subject: [PATCH] Add integration test for mount action (#659). --- tests/integration/borg/test_commands.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/integration/borg/test_commands.py b/tests/integration/borg/test_commands.py index 11fbe98..a76d43f 100644 --- a/tests/integration/borg/test_commands.py +++ b/tests/integration/borg/test_commands.py @@ -5,6 +5,8 @@ from flexmock import flexmock import borgmatic.borg.info import borgmatic.borg.list +import borgmatic.borg.mount +import borgmatic.borg.prune import borgmatic.borg.rlist import borgmatic.borg.transfer import borgmatic.commands.arguments @@ -89,6 +91,28 @@ def test_prune_archives_command_does_not_duplicate_flags_or_raise(): ) +def test_mount_archive_command_does_not_duplicate_flags_or_raise(): + arguments = borgmatic.commands.arguments.parse_arguments('mount', '--mount-point', 'tmp')[ + 'mount' + ] + flexmock(borgmatic.borg.mount).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.mount.mount_archive( + 'repo', + 'archive', + fuzz_argument(arguments, argument_name), + {}, + '2.3.4', + argparse.Namespace(log_json=False), + ) + + def test_make_list_command_does_not_duplicate_flags_or_raise(): arguments = borgmatic.commands.arguments.parse_arguments('list')['list']