From 7605838bfefbdac0f072456ea9e59627ada5e5aa Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 16 Mar 2023 13:27:08 -0700 Subject: [PATCH] Add "--repository" flag to all actions where it makes sense (#564). --- NEWS | 2 ++ tests/unit/actions/test_check.py | 2 +- tests/unit/actions/test_compact.py | 2 +- tests/unit/actions/test_create.py | 2 +- tests/unit/actions/test_prune.py | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 154e6f3..0e8dd5e 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ "create", "prune", "compact", "check". If you'd like to retain the old ordering ("prune" and "compact" first), then specify actions explicitly on the command-line. * #304: Run any command-line actions in the order specified instead of using a fixed ordering. + * #564: Add "--repository" flag to all actions where it makes sense, so you can run borgmatic on + a single configured repository instead of all of them. * #628: Add a Healthchecks "log" state to send borgmatic logs to Healthchecks without signalling success or failure. * #647: Add "--strip-components all" feature on the "extract" action to remove leading path diff --git a/tests/unit/actions/test_check.py b/tests/unit/actions/test_check.py index bd0cf1c..3e1a9c2 100644 --- a/tests/unit/actions/test_check.py +++ b/tests/unit/actions/test_check.py @@ -32,7 +32,7 @@ def test_run_check_calls_hooks_for_configured_repository(): ) -def test_run_check_runs_with_select_repository(): +def test_run_check_runs_with_selected_repository(): flexmock(module.logger).answer = lambda message: None flexmock(module.borgmatic.config.validate).should_receive( 'repositories_match' diff --git a/tests/unit/actions/test_compact.py b/tests/unit/actions/test_compact.py index 97f3d5b..4dae903 100644 --- a/tests/unit/actions/test_compact.py +++ b/tests/unit/actions/test_compact.py @@ -30,7 +30,7 @@ def test_compact_actions_calls_hooks_for_configured_repository(): ) -def test_compact_runs_with_select_repository(): +def test_compact_runs_with_selected_repository(): flexmock(module.logger).answer = lambda message: None flexmock(module.borgmatic.config.validate).should_receive( 'repositories_match' diff --git a/tests/unit/actions/test_create.py b/tests/unit/actions/test_create.py index 6eb18c2..8a9d0b4 100644 --- a/tests/unit/actions/test_create.py +++ b/tests/unit/actions/test_create.py @@ -39,7 +39,7 @@ def test_run_create_executes_and_calls_hooks_for_configured_repository(): ) -def test_run_create_runs_with_select_repository(): +def test_run_create_runs_with_selected_repository(): flexmock(module.logger).answer = lambda message: None flexmock(module.borgmatic.config.validate).should_receive( 'repositories_match' diff --git a/tests/unit/actions/test_prune.py b/tests/unit/actions/test_prune.py index b911989..db9c124 100644 --- a/tests/unit/actions/test_prune.py +++ b/tests/unit/actions/test_prune.py @@ -3,7 +3,7 @@ from flexmock import flexmock from borgmatic.actions import prune as module -def test_run_prune_calls_hooks_of_configured_repository(): +def test_run_prune_calls_hooks_for_configured_repository(): flexmock(module.logger).answer = lambda message: None flexmock(module.borgmatic.config.validate).should_receive('repositories_match').never() flexmock(module.borgmatic.borg.prune).should_receive('prune_archives').once() @@ -27,7 +27,7 @@ def test_run_prune_calls_hooks_of_configured_repository(): ) -def test_run_prune_runs_with_select_repository(): +def test_run_prune_runs_with_selected_repository(): flexmock(module.logger).answer = lambda message: None flexmock(module.borgmatic.config.validate).should_receive( 'repositories_match'