Ver código fonte

Code formatting (#725).

Dan Helfman 1 ano atrás
pai
commit
c5c3e2e0ce

+ 3 - 3
tests/unit/actions/test_create.py

@@ -39,6 +39,7 @@ def test_run_create_executes_and_calls_hooks_for_configured_repository():
         )
         )
     )
     )
 
 
+
 def test_run_create_with_store_config_files_false_does_not_create_borgmatic_manifest():
 def test_run_create_with_store_config_files_false_does_not_create_borgmatic_manifest():
     flexmock(module.logger).answer = lambda message: None
     flexmock(module.logger).answer = lambda message: None
     flexmock(module.borgmatic.config.validate).should_receive('repositories_match').never()
     flexmock(module.borgmatic.config.validate).should_receive('repositories_match').never()
@@ -62,9 +63,7 @@ def test_run_create_with_store_config_files_false_does_not_create_borgmatic_mani
         module.run_create(
         module.run_create(
             config_filename='test.yaml',
             config_filename='test.yaml',
             repository={'path': 'repo'},
             repository={'path': 'repo'},
-            config={
-                'store_config_files': False
-            },
+            config={'store_config_files': False},
             hook_context={},
             hook_context={},
             local_borg_version=None,
             local_borg_version=None,
             create_arguments=create_arguments,
             create_arguments=create_arguments,
@@ -75,6 +74,7 @@ def test_run_create_with_store_config_files_false_does_not_create_borgmatic_mani
         )
         )
     )
     )
 
 
+
 def test_run_create_runs_with_selected_repository():
 def test_run_create_runs_with_selected_repository():
     flexmock(module.logger).answer = lambda message: None
     flexmock(module.logger).answer = lambda message: None
     flexmock(module.borgmatic.config.validate).should_receive(
     flexmock(module.borgmatic.config.validate).should_receive(

+ 5 - 5
tests/unit/borg/test_create.py

@@ -646,18 +646,17 @@ def test_create_archive_with_sources_and_used_config_paths_calls_borg_with_sourc
         global_arguments=flexmock(log_json=False, used_config_paths=['/etc/borgmatic/config.yaml']),
         global_arguments=flexmock(log_json=False, used_config_paths=['/etc/borgmatic/config.yaml']),
     )
     )
 
 
+
 def test_create_archive_with_sources_and_used_config_paths_with_store_config_files_false_calls_borg_with_sources_and_no_config_paths():
 def test_create_archive_with_sources_and_used_config_paths_with_store_config_files_false_calls_borg_with_sources_and_no_config_paths():
     flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
     flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
     flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
     flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
     flexmock(module).should_receive('collect_borgmatic_source_directories').and_return([])
     flexmock(module).should_receive('collect_borgmatic_source_directories').and_return([])
-    flexmock(module).should_receive('deduplicate_directories').and_return(
-        ('foo', 'bar')
-    )
+    flexmock(module).should_receive('deduplicate_directories').and_return(('foo', 'bar'))
     flexmock(module).should_receive('map_directories_to_devices').and_return({})
     flexmock(module).should_receive('map_directories_to_devices').and_return({})
     flexmock(module).should_receive('expand_directories').with_args([]).and_return(())
     flexmock(module).should_receive('expand_directories').with_args([]).and_return(())
-    flexmock(module).should_receive('expand_directories').with_args(
+    flexmock(module).should_receive('expand_directories').with_args(('foo', 'bar')).and_return(
         ('foo', 'bar')
         ('foo', 'bar')
-    ).and_return(('foo', 'bar'))
+    )
     flexmock(module).should_receive('expand_directories').with_args([]).and_return(())
     flexmock(module).should_receive('expand_directories').with_args([]).and_return(())
     flexmock(module).should_receive('pattern_root_directories').and_return([])
     flexmock(module).should_receive('pattern_root_directories').and_return([])
     flexmock(module.os.path).should_receive('expanduser').and_raise(TypeError)
     flexmock(module.os.path).should_receive('expanduser').and_raise(TypeError)
@@ -694,6 +693,7 @@ def test_create_archive_with_sources_and_used_config_paths_with_store_config_fil
         global_arguments=flexmock(log_json=False, used_config_paths=['/etc/borgmatic/config.yaml']),
         global_arguments=flexmock(log_json=False, used_config_paths=['/etc/borgmatic/config.yaml']),
     )
     )
 
 
+
 def test_create_archive_with_exclude_patterns_calls_borg_with_excludes():
 def test_create_archive_with_exclude_patterns_calls_borg_with_excludes():
     flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
     flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
     flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
     flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER