Fixed regression issue in taking backup of the table. Added some more test cases.
parent
59649ca42c
commit
e582ffca38
|
@ -380,9 +380,9 @@ def _get_args_params_values(data, conn, backup_obj_type, backup_file, server,
|
||||||
|
|
||||||
args.extend(
|
args.extend(
|
||||||
functools.reduce(operator.iconcat, map(
|
functools.reduce(operator.iconcat, map(
|
||||||
lambda s, t: ['--table',
|
lambda t: ['--table',
|
||||||
r'{0}'.format(driver.qtIdent(conn, s, t)
|
r'{0}'.format(driver.qtIdent(conn, t[0], t[1])
|
||||||
.replace('"', '\"'))],
|
.replace('"', '\"'))],
|
||||||
data.get('tables', [])), []
|
data.get('tables', [])), []
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -405,7 +405,58 @@ class BackupCreateJobTest(BaseTestGenerator):
|
||||||
not_expected_cmd_opts=[],
|
not_expected_cmd_opts=[],
|
||||||
expected_exit_code=[0, None]
|
expected_exit_code=[0, None]
|
||||||
)),
|
)),
|
||||||
|
('When backup a schema with default options',
|
||||||
|
dict(
|
||||||
|
class_params=dict(
|
||||||
|
sid=1,
|
||||||
|
name='test_backup_server',
|
||||||
|
port=5444,
|
||||||
|
host='localhost',
|
||||||
|
database='postgres',
|
||||||
|
bfile='test_backup',
|
||||||
|
username='postgres'
|
||||||
|
),
|
||||||
|
params=dict(
|
||||||
|
file='test_backup_file',
|
||||||
|
format='custom',
|
||||||
|
verbose=True,
|
||||||
|
blobs=True,
|
||||||
|
schemas=['schema1'],
|
||||||
|
tables=[],
|
||||||
|
database='postgres'
|
||||||
|
),
|
||||||
|
url='/backup/job/{0}/object',
|
||||||
|
expected_cmd_opts=['--verbose', '--format=c', '--blobs',
|
||||||
|
'--schema', 'schema1'],
|
||||||
|
not_expected_cmd_opts=[],
|
||||||
|
expected_exit_code=[0, None]
|
||||||
|
)),
|
||||||
|
('When backup a table with default options',
|
||||||
|
dict(
|
||||||
|
class_params=dict(
|
||||||
|
sid=1,
|
||||||
|
name='test_backup_server',
|
||||||
|
port=5444,
|
||||||
|
host='localhost',
|
||||||
|
database='postgres',
|
||||||
|
bfile='test_backup',
|
||||||
|
username='postgres'
|
||||||
|
),
|
||||||
|
params=dict(
|
||||||
|
file='test_backup_file',
|
||||||
|
format='custom',
|
||||||
|
verbose=True,
|
||||||
|
blobs=True,
|
||||||
|
schemas=[],
|
||||||
|
tables=[['public', 'table1']],
|
||||||
|
database='postgres'
|
||||||
|
),
|
||||||
|
url='/backup/job/{0}/object',
|
||||||
|
expected_cmd_opts=['--verbose', '--format=c', '--blobs',
|
||||||
|
'--table', 'public.table1'],
|
||||||
|
not_expected_cmd_opts=[],
|
||||||
|
expected_exit_code=[0, None]
|
||||||
|
)),
|
||||||
('When backup the server',
|
('When backup the server',
|
||||||
dict(
|
dict(
|
||||||
class_params=dict(
|
class_params=dict(
|
||||||
|
|
Loading…
Reference in New Issue