From a7f81d538de55d3fed40e1181e06f270626a53c6 Mon Sep 17 00:00:00 2001 From: Soumik Dutta Date: Mon, 29 May 2023 01:09:00 +0530 Subject: [PATCH] nit changes - help strings in borgmatic commands - test fixes in test_logger and test_borgmatic Signed-off-by: Soumik Dutta --- borgmatic/commands/arguments.py | 6 +++--- tests/unit/commands/test_borgmatic.py | 1 - tests/unit/test_logger.py | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/borgmatic/commands/arguments.py b/borgmatic/commands/arguments.py index f5a2c40..6039e4f 100644 --- a/borgmatic/commands/arguments.py +++ b/borgmatic/commands/arguments.py @@ -154,21 +154,21 @@ def make_parsers(): type=int, choices=range(-2, 3), default=0, - help='Display verbose progress to the console (from disabled, errors only, default, some, or lots: -2, -1, 0, 1, or 2)', + help='Display verbose progress to the console (disabled, errors only, default, some, or lots: -2, -1, 0, 1, or 2)', ) global_group.add_argument( '--syslog-verbosity', type=int, choices=range(-2, 3), default=0, - help='Log verbose progress to syslog (from disabled, errors only, default, some, or lots: -2, -1, 0, 1, or 2). Ignored when console is interactive or --log-file is given', + help='Log verbose progress to syslog (disabled, errors only, default, some, or lots: -2, -1, 0, 1, or 2). Ignored when console is interactive or --log-file is given', ) global_group.add_argument( '--log-file-verbosity', type=int, choices=range(-2, 3), default=0, - help='Log verbose progress to log file (from disabled, errors only, default, some, or lots: -2, -1, 0, 1, or 2). Only used when --log-file is given', + help='Log verbose progress to log file (disabled, errors only, default, some, or lots: -2, -1, 0, 1, or 2). Only used when --log-file is given', ) global_group.add_argument( '--monitoring-verbosity', diff --git a/tests/unit/commands/test_borgmatic.py b/tests/unit/commands/test_borgmatic.py index 144de18..9b8bf58 100644 --- a/tests/unit/commands/test_borgmatic.py +++ b/tests/unit/commands/test_borgmatic.py @@ -175,7 +175,6 @@ def test_run_configuration_does_not_call_monitoring_hooks_if_monitoring_hooks_ar flexmock(module.dispatch).should_receive('call_hooks').never() flexmock(module).should_receive('run_actions').and_return([]) - flexmock(module.dispatch).should_receive('call_hooks').never() config = {'location': {'repositories': [{'path': 'foo'}]}} arguments = {'global': flexmock(monitoring_verbosity=-2, dry_run=False), 'create': flexmock()} diff --git a/tests/unit/test_logger.py b/tests/unit/test_logger.py index 84072de..f86aacd 100644 --- a/tests/unit/test_logger.py +++ b/tests/unit/test_logger.py @@ -314,7 +314,7 @@ def test_configure_logging_skips_log_file_if_log_file_logging_is_disabled(): flexmock(module.logging).should_receive('basicConfig').with_args( level=logging.INFO, handlers=tuple ) - flexmock(module.os.path).should_receive('exists').with_args('/dev/log').never() + flexmock(module.os.path).should_receive('exists').never() flexmock(module.logging.handlers).should_receive('SysLogHandler').never() flexmock(module.logging.handlers).should_receive('WatchedFileHandler').never() @@ -335,7 +335,7 @@ def test_configure_logging_to_log_file_instead_of_syslog(): flexmock(module.logging).should_receive('basicConfig').with_args( level=logging.DEBUG, handlers=tuple ) - flexmock(module.os.path).should_receive('exists').with_args('/dev/log').and_return(True) + flexmock(module.os.path).should_receive('exists').never() flexmock(module.logging.handlers).should_receive('SysLogHandler').never() file_handler = logging.handlers.WatchedFileHandler('/tmp/logfile') flexmock(module.logging.handlers).should_receive('WatchedFileHandler').with_args(