|
@@ -32,6 +32,19 @@ def test_collect_config_filenames_collects_files_from_given_directories_and_igno
|
|
|
)
|
|
|
|
|
|
|
|
|
+def test_collect_config_filenames_skips_etc_borgmatic_config_dot_yaml_if_it_does_not_exist():
|
|
|
+ config_paths = ('config.yaml', '/etc/borgmatic/config.yaml')
|
|
|
+ mock_path = flexmock(module.os.path)
|
|
|
+ mock_path.should_receive('exists').with_args('config.yaml').and_return(True)
|
|
|
+ mock_path.should_receive('exists').with_args('/etc/borgmatic/config.yaml').and_return(False)
|
|
|
+ mock_path.should_receive('isdir').with_args('config.yaml').and_return(False)
|
|
|
+ mock_path.should_receive('isdir').with_args('/etc/borgmatic/config.yaml').and_return(True)
|
|
|
+
|
|
|
+ config_filenames = tuple(module.collect_config_filenames(config_paths))
|
|
|
+
|
|
|
+ assert config_filenames == ('config.yaml',)
|
|
|
+
|
|
|
+
|
|
|
def test_collect_config_filenames_skips_etc_borgmatic_dot_d_if_it_does_not_exist():
|
|
|
config_paths = ('config.yaml', '/etc/borgmatic.d')
|
|
|
mock_path = flexmock(module.os.path)
|
|
@@ -45,7 +58,7 @@ def test_collect_config_filenames_skips_etc_borgmatic_dot_d_if_it_does_not_exist
|
|
|
assert config_filenames == ('config.yaml',)
|
|
|
|
|
|
|
|
|
-def test_collect_config_filenames_includes_directory_if_it_does_not_exist():
|
|
|
+def test_collect_config_filenames_includes_other_directory_if_it_does_not_exist():
|
|
|
config_paths = ('config.yaml', '/my/directory')
|
|
|
mock_path = flexmock(module.os.path)
|
|
|
mock_path.should_receive('exists').with_args('config.yaml').and_return(True)
|