make sure restore params in config aren't used when cli args are supplied

This commit is contained in:
Divyansh Singh 2023-06-21 00:03:07 +05:30
parent 1a21eb03cd
commit 87c6e5b349
4 changed files with 22 additions and 2 deletions

View file

@ -304,6 +304,10 @@ def test_restore_database_dump_with_connection_params_uses_connection_params_for
'username': 'mongo',
'password': 'trustsome1',
'authentication_database': 'admin',
'restore_hostname': 'restorehost',
'restore_port': 'restoreport',
'restore_username': 'restoreusername',
'restore_password': 'restorepassword',
'schemas': None,
}
]

View file

@ -519,7 +519,17 @@ def test_restore_database_dump_runs_mysql_with_username_and_password():
def test_restore_database_dump_with_connection_params_uses_connection_params_for_restore():
database_config = [{'name': 'foo', 'username': 'root', 'password': 'trustsome1'}]
database_config = [
{
'name': 'foo',
'username': 'root',
'password': 'trustsome1',
'restore_hostname': 'restorehost',
'restore_port': 'restoreport',
'restore_username': 'restoreusername',
'restore_password': 'restorepassword',
}
]
extract_process = flexmock(stdout=flexmock())
flexmock(module).should_receive('execute_command_with_processes').with_args(

View file

@ -656,6 +656,10 @@ def test_restore_database_dump_with_connection_params_uses_connection_params_for
'port': 5433,
'username': 'postgres',
'password': 'trustsome1',
'restore_hostname': 'restorehost',
'restore_port': 'restoreport',
'restore_username': 'restoreusername',
'restore_password': 'restorepassword',
'schemas': None,
}
]

View file

@ -118,7 +118,9 @@ def test_restore_database_dump_restores_database():
def test_restore_database_dump_with_connection_params_uses_connection_params_for_restore():
database_config = [{'path': '/path/to/database', 'name': 'database'}]
database_config = [
{'path': '/path/to/database', 'name': 'database', 'restore_path': 'config/path/to/database'}
]
extract_process = flexmock(stdout=flexmock())
flexmock(module).should_receive('execute_command_with_processes').with_args(