mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-27 02:08:54 +00:00
fixup! Add borg config command (fixes #3304)
Don't use list unpacking for function calls in order to support py3.4 Reword basic borg config help It doesn't edit the repo config, but any borg-related config.
This commit is contained in:
parent
15d9c94981
commit
5331b378f7
2 changed files with 15 additions and 9 deletions
|
@ -3733,7 +3733,7 @@ def define_archive_filters_group(subparser, *, sort_by=True, first_last=True):
|
|||
description=self.do_config.__doc__,
|
||||
epilog=config_epilog,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
help='get and set repository config options')
|
||||
help='get and set configuration values')
|
||||
subparser.set_defaults(func=self.do_config)
|
||||
subparser.add_argument('-c', '--cache', dest='cache', action='store_true',
|
||||
help='get and set values from the repo cache')
|
||||
|
|
|
@ -2782,14 +2782,20 @@ def test_config(self):
|
|||
self.create_test_files()
|
||||
os.unlink('input/flagfile')
|
||||
self.cmd('init', '--encryption=repokey', self.repository_location)
|
||||
for flags in [[], ['--cache']]:
|
||||
for cfg_key in {'testkey', 'testsection.testkey'}:
|
||||
self.cmd('config', self.repository_location, *flags, cfg_key, exit_code=1)
|
||||
self.cmd('config', self.repository_location, *flags, cfg_key, 'testcontents')
|
||||
output = self.cmd('config', self.repository_location, *flags, cfg_key)
|
||||
assert output == 'testcontents\n'
|
||||
self.cmd('config', self.repository_location, *flags, '--delete', cfg_key)
|
||||
self.cmd('config', self.repository_location, *flags, cfg_key, exit_code=1)
|
||||
for cfg_key in {'testkey', 'testsection.testkey'}:
|
||||
self.cmd('config', self.repository_location, cfg_key, exit_code=1)
|
||||
self.cmd('config', self.repository_location, cfg_key, 'testcontents')
|
||||
output = self.cmd('config', self.repository_location, cfg_key)
|
||||
assert output == 'testcontents\n'
|
||||
self.cmd('config', self.repository_location, '--delete', cfg_key)
|
||||
self.cmd('config', self.repository_location, cfg_key, exit_code=1)
|
||||
|
||||
self.cmd('config', self.repository_location, '--cache', cfg_key, exit_code=1)
|
||||
self.cmd('config', self.repository_location, '--cache', cfg_key, 'testcontents')
|
||||
output = self.cmd('config', self.repository_location, '--cache', cfg_key)
|
||||
assert output == 'testcontents\n'
|
||||
self.cmd('config', self.repository_location, '--cache', '--delete', cfg_key)
|
||||
self.cmd('config', self.repository_location, '--cache', cfg_key, exit_code=1)
|
||||
|
||||
requires_gnutar = pytest.mark.skipif(not have_gnutar(), reason='GNU tar must be installed for this test.')
|
||||
requires_gzip = pytest.mark.skipif(not shutil.which('gzip'), reason='gzip must be installed for this test.')
|
||||
|
|
Loading…
Reference in a new issue