Fixed #29501 -- Allowed dbshell to pass options to underlying tool.

This commit is contained in:
Adam Johnson 2020-04-14 08:56:40 +01:00
parent 8e8c3f964e
commit 5b884d45ac
13 changed files with 117 additions and 21 deletions

View file

@ -76,5 +76,23 @@ class MySqlDbshellCommandTestCase(SimpleTestCase):
},
}))
def get_command_line_arguments(self, connection_settings):
return DatabaseClient.settings_to_cmd_args(connection_settings)
def test_parameters(self):
self.assertEqual(
['mysql', 'somedbname', '--help'],
self.get_command_line_arguments(
{
'NAME': 'somedbname',
'USER': None,
'PASSWORD': None,
'HOST': None,
'PORT': None,
'OPTIONS': {},
},
['--help'],
),
)
def get_command_line_arguments(self, connection_settings, parameters=None):
if parameters is None:
parameters = []
return DatabaseClient.settings_to_cmd_args(connection_settings, parameters)