Make inputs and backup_dir optional in the config file
They can come from -i and -o; missing ones were rejected as a bad configuration file (exit code 6).
This commit is contained in:
@@ -224,9 +224,15 @@ backup_dir=/backups
|
||||
sb._read_config(config_file, USER)
|
||||
|
||||
|
||||
def test_inputs_and_backup_dir_optional(tmp_path: Path) -> None:
|
||||
config_args = sb._read_config(write_config(tmp_path, '[backup]\nkeep=2\n'), USER)
|
||||
|
||||
assert config_args['inputs'] is None
|
||||
assert config_args['output'] is None
|
||||
assert config_args['keep'] == 2
|
||||
|
||||
|
||||
@pytest.mark.parametrize('text', [
|
||||
'[backup]\nbackup_dir=/backups\n',
|
||||
'[backup]\ninputs=/tmp\n',
|
||||
'[other]\ninputs=/tmp\n',
|
||||
'inputs=/tmp\n',
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user