|
@@ -629,6 +629,9 @@ def test_restore_data_source_dump_runs_mysql_to_restore():
|
|
|
flexmock(module.borgmatic.hooks.credential.parse).should_receive(
|
|
|
'resolve_credential'
|
|
|
).replace_with(lambda value, config: value)
|
|
|
+ flexmock(module.borgmatic.hooks.data_source.mariadb).should_receive(
|
|
|
+ 'make_defaults_file_pipe'
|
|
|
+ ).with_args(None, None).and_return(None)
|
|
|
flexmock(module.os).should_receive('environ').and_return({'USER': 'root'})
|
|
|
flexmock(module).should_receive('execute_command_with_processes').with_args(
|
|
|
('mysql', '--batch'),
|
|
@@ -661,6 +664,9 @@ def test_restore_data_source_dump_runs_mysql_with_options():
|
|
|
flexmock(module.borgmatic.hooks.credential.parse).should_receive(
|
|
|
'resolve_credential'
|
|
|
).replace_with(lambda value, config: value)
|
|
|
+ flexmock(module.borgmatic.hooks.data_source.mariadb).should_receive(
|
|
|
+ 'make_defaults_file_pipe'
|
|
|
+ ).with_args(None, None).and_return(None)
|
|
|
flexmock(module.os).should_receive('environ').and_return({'USER': 'root'})
|
|
|
flexmock(module).should_receive('execute_command_with_processes').with_args(
|
|
|
('mysql', '--batch', '--harder'),
|
|
@@ -693,6 +699,9 @@ def test_restore_data_source_dump_runs_non_default_mysql_with_options():
|
|
|
flexmock(module.borgmatic.hooks.credential.parse).should_receive(
|
|
|
'resolve_credential'
|
|
|
).replace_with(lambda value, config: value)
|
|
|
+ flexmock(module.borgmatic.hooks.data_source.mariadb).should_receive(
|
|
|
+ 'make_defaults_file_pipe'
|
|
|
+ ).with_args(None, None).and_return(None)
|
|
|
flexmock(module.os).should_receive('environ').and_return({'USER': 'root'})
|
|
|
flexmock(module).should_receive('execute_command_with_processes').with_args(
|
|
|
('custom_mysql', '--batch', '--harder'),
|
|
@@ -725,6 +734,9 @@ def test_restore_data_source_dump_runs_mysql_with_hostname_and_port():
|
|
|
flexmock(module.borgmatic.hooks.credential.parse).should_receive(
|
|
|
'resolve_credential'
|
|
|
).replace_with(lambda value, config: value)
|
|
|
+ flexmock(module.borgmatic.hooks.data_source.mariadb).should_receive(
|
|
|
+ 'make_defaults_file_pipe'
|
|
|
+ ).with_args(None, None).and_return(None)
|
|
|
flexmock(module.os).should_receive('environ').and_return({'USER': 'root'})
|
|
|
flexmock(module).should_receive('execute_command_with_processes').with_args(
|
|
|
(
|
|
@@ -912,6 +924,9 @@ def test_restore_data_source_dump_with_dry_run_skips_restore():
|
|
|
flexmock(module.borgmatic.hooks.credential.parse).should_receive(
|
|
|
'resolve_credential'
|
|
|
).replace_with(lambda value, config: value)
|
|
|
+ flexmock(module.borgmatic.hooks.data_source.mariadb).should_receive(
|
|
|
+ 'make_defaults_file_pipe'
|
|
|
+ ).with_args(None, None).and_return(None)
|
|
|
flexmock(module.os).should_receive('environ').and_return({'USER': 'root'})
|
|
|
flexmock(module).should_receive('execute_command_with_processes').never()
|
|
|
|