mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix template handling in tests for Windows.
This commit is contained in:
committed by
Dave Page
parent
bc4d16eb83
commit
ab27b9d118
@@ -23,8 +23,7 @@ class TestExplainPlanTemplates(BaseTestGenerator):
|
||||
'when passing all parameters,'
|
||||
'it returns the explain plan with all parameters',
|
||||
dict(
|
||||
template_path=os.path.join('sqleditor', 'sql', 'default',
|
||||
'explain_plan.sql'),
|
||||
template_path='sqleditor/sql/default/explain_plan.sql',
|
||||
input_parameters=dict(
|
||||
sql='SELECT * FROM places',
|
||||
format='xml',
|
||||
@@ -45,8 +44,7 @@ class TestExplainPlanTemplates(BaseTestGenerator):
|
||||
'when not all parameters are present,'
|
||||
'it returns the explain plan with the present parameters',
|
||||
dict(
|
||||
template_path=os.path.join('sqleditor', 'sql', 'default',
|
||||
'explain_plan.sql'),
|
||||
template_path='sqleditor/sql/default/explain_plan.sql',
|
||||
input_parameters=dict(
|
||||
sql='SELECT * FROM places',
|
||||
format='json',
|
||||
@@ -63,8 +61,7 @@ class TestExplainPlanTemplates(BaseTestGenerator):
|
||||
'when timing is present,'
|
||||
'it returns the explain plan with timing',
|
||||
dict(
|
||||
template_path=os.path.join('sqleditor', 'sql', '9.2_plus',
|
||||
'explain_plan.sql'),
|
||||
template_path='sqleditor/sql/9.2_plus/explain_plan.sql',
|
||||
input_parameters=dict(
|
||||
sql='SELECT * FROM places',
|
||||
format='json',
|
||||
@@ -82,8 +79,7 @@ class TestExplainPlanTemplates(BaseTestGenerator):
|
||||
'when summary is present,'
|
||||
'it returns the explain plan with summary',
|
||||
dict(
|
||||
template_path=os.path.join('sqleditor', 'sql', '10_plus',
|
||||
'explain_plan.sql'),
|
||||
template_path='sqleditor/sql/10_plus/explain_plan.sql',
|
||||
input_parameters=dict(
|
||||
sql='SELECT * FROM places',
|
||||
format='yaml',
|
||||
@@ -103,8 +99,7 @@ class TestExplainPlanTemplates(BaseTestGenerator):
|
||||
'when all parameters are present,'
|
||||
'it returns the explain without parameters',
|
||||
dict(
|
||||
template_path=os.path.join('sqleditor', 'sql', 'gpdb_5.0_plus',
|
||||
'explain_plan.sql'),
|
||||
template_path='sqleditor/sql/gpdb_5.0_plus/explain_plan.sql',
|
||||
input_parameters=dict(
|
||||
sql='SELECT * FROM places',
|
||||
format='json',
|
||||
@@ -119,8 +114,7 @@ class TestExplainPlanTemplates(BaseTestGenerator):
|
||||
'when analyze is true,'
|
||||
'it returns the explain analyze',
|
||||
dict(
|
||||
template_path=os.path.join('sqleditor', 'sql', 'gpdb_5.0_plus',
|
||||
'explain_plan.sql'),
|
||||
template_path='sqleditor/sql/gpdb_5.0_plus/explain_plan.sql',
|
||||
input_parameters=dict(
|
||||
sql='SELECT * FROM places',
|
||||
analyze=True
|
||||
@@ -134,8 +128,7 @@ class TestExplainPlanTemplates(BaseTestGenerator):
|
||||
'when analyze is false,'
|
||||
'it returns the only explain',
|
||||
dict(
|
||||
template_path=os.path.join('sqleditor', 'sql', 'gpdb_5.0_plus',
|
||||
'explain_plan.sql'),
|
||||
template_path='sqleditor/sql/gpdb_5.0_plus/explain_plan.sql',
|
||||
input_parameters=dict(
|
||||
sql='SELECT * FROM places',
|
||||
analyze=False
|
||||
|
@@ -35,10 +35,7 @@ class TestViewDataTemplates(BaseTestGenerator):
|
||||
(
|
||||
'When inserting and selecting table data with only PK',
|
||||
dict(
|
||||
insert_template_path=os.path.join('sqleditor',
|
||||
'sql',
|
||||
'default',
|
||||
'insert.sql'),
|
||||
insert_template_path='sqleditor/sql/default/insert.sql',
|
||||
insert_parameters=dict(
|
||||
data_to_be_saved=data_to_be_saved,
|
||||
primary_keys=None,
|
||||
@@ -54,10 +51,7 @@ class TestViewDataTemplates(BaseTestGenerator):
|
||||
' (%(id)s::integer, '
|
||||
'%(text)s::text)'
|
||||
' returning id;',
|
||||
select_template_path=os.path.join('sqleditor',
|
||||
'sql',
|
||||
'default',
|
||||
'select.sql'),
|
||||
select_template_path='sqleditor/sql/default/select.sql',
|
||||
select_parameters=dict(
|
||||
object_name='test_table',
|
||||
nsp_name='test_schema',
|
||||
@@ -71,10 +65,7 @@ class TestViewDataTemplates(BaseTestGenerator):
|
||||
(
|
||||
'When inserting and selecting table data with multiple PK',
|
||||
dict(
|
||||
insert_template_path=os.path.join('sqleditor',
|
||||
'sql',
|
||||
'default',
|
||||
'insert.sql'),
|
||||
insert_template_path='sqleditor/sql/default/insert.sql',
|
||||
insert_parameters=dict(
|
||||
data_to_be_saved=data_to_be_saved,
|
||||
primary_keys=None,
|
||||
@@ -90,10 +81,7 @@ class TestViewDataTemplates(BaseTestGenerator):
|
||||
' VALUES (%(id)s::integer,'
|
||||
' %(text)s::text)'
|
||||
' returning id, text;',
|
||||
select_template_path=os.path.join('sqleditor',
|
||||
'sql',
|
||||
'default',
|
||||
'select.sql'),
|
||||
select_template_path='sqleditor/sql/default/select.sql',
|
||||
select_parameters=dict(
|
||||
object_name='test_table',
|
||||
nsp_name='test_schema',
|
||||
@@ -109,10 +97,7 @@ class TestViewDataTemplates(BaseTestGenerator):
|
||||
(
|
||||
'When inserting and selecting table data with PK and OID',
|
||||
dict(
|
||||
insert_template_path=os.path.join('sqleditor',
|
||||
'sql',
|
||||
'default',
|
||||
'insert.sql'),
|
||||
insert_template_path='sqleditor/sql/default/insert.sql',
|
||||
insert_parameters=dict(
|
||||
data_to_be_saved=data_to_be_saved,
|
||||
primary_keys=None,
|
||||
@@ -128,10 +113,7 @@ class TestViewDataTemplates(BaseTestGenerator):
|
||||
' (%(id)s::integer, '
|
||||
'%(text)s::text) '
|
||||
'returning oid;',
|
||||
select_template_path=os.path.join('sqleditor',
|
||||
'sql',
|
||||
'default',
|
||||
'select.sql'),
|
||||
select_template_path='sqleditor/sql/default/select.sql',
|
||||
select_parameters=dict(
|
||||
object_name='test_table',
|
||||
nsp_name='test_schema',
|
||||
@@ -145,10 +127,7 @@ class TestViewDataTemplates(BaseTestGenerator):
|
||||
(
|
||||
'When inserting and selecting table data with only OID',
|
||||
dict(
|
||||
insert_template_path=os.path.join('sqleditor',
|
||||
'sql',
|
||||
'default',
|
||||
'insert.sql'),
|
||||
insert_template_path='sqleditor/sql/default/insert.sql',
|
||||
insert_parameters=dict(
|
||||
data_to_be_saved=data_to_be_saved,
|
||||
primary_keys=None,
|
||||
@@ -164,10 +143,7 @@ class TestViewDataTemplates(BaseTestGenerator):
|
||||
' (%(id)s::integer,'
|
||||
' %(text)s::text)'
|
||||
' returning oid;',
|
||||
select_template_path=os.path.join('sqleditor',
|
||||
'sql',
|
||||
'default',
|
||||
'select.sql'),
|
||||
select_template_path='sqleditor/sql/default/select.sql',
|
||||
select_parameters=dict(
|
||||
object_name='test_table',
|
||||
nsp_name='test_schema',
|
||||
|
Reference in New Issue
Block a user