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
@@ -69,9 +69,8 @@ class TestExternalTablesView(BaseTestGenerator):
|
||||
connection=MagicMock(execute_2darray=MagicMock()),
|
||||
execute_2darray_return_value=(True, dict(rows=[])),
|
||||
|
||||
expect_render_template_called_with=os.path.join('sql',
|
||||
'#gpdb#80323#',
|
||||
'list.sql'),
|
||||
expect_render_template_called_with=os.path.join(
|
||||
'sql/#gpdb#80323#', 'list.sql'),
|
||||
expected_make_json_response_called_with=dict(
|
||||
data=[],
|
||||
status=200
|
||||
@@ -93,9 +92,8 @@ class TestExternalTablesView(BaseTestGenerator):
|
||||
connection=MagicMock(execute_2darray=MagicMock()),
|
||||
execute_2darray_return_value=(False, 'Some error message'),
|
||||
|
||||
expect_render_template_called_with=os.path.join('sql',
|
||||
'#gpdb#80323#',
|
||||
'list.sql'),
|
||||
expect_render_template_called_with=os.path.join(
|
||||
'sql/#gpdb#80323#', 'list.sql'),
|
||||
expected_internal_server_error_called_with=dict(
|
||||
errormsg='Some error message'
|
||||
),
|
||||
@@ -127,9 +125,8 @@ class TestExternalTablesView(BaseTestGenerator):
|
||||
]
|
||||
)),
|
||||
|
||||
expect_render_template_called_with=os.path.join('sql',
|
||||
'#gpdb#80323#',
|
||||
'list.sql'),
|
||||
expect_render_template_called_with=os.path.join(
|
||||
'sql/#gpdb#80323#', 'list.sql'),
|
||||
expected_make_json_response_called_with=dict(
|
||||
data=[
|
||||
{
|
||||
@@ -174,9 +171,8 @@ class TestExternalTablesView(BaseTestGenerator):
|
||||
execute_2darray_return_value=(False, 'Some error message'),
|
||||
|
||||
expect_render_template_called_with=dict(
|
||||
template_name_or_list=os.path.join('sql',
|
||||
'#gpdb#80323#',
|
||||
'node.sql'),
|
||||
template_name_or_list=os.path.join(
|
||||
'sql/#gpdb#80323#', 'node.sql'),
|
||||
external_table_id=11
|
||||
),
|
||||
expected_internal_server_error_called_with=dict(
|
||||
@@ -201,9 +197,8 @@ class TestExternalTablesView(BaseTestGenerator):
|
||||
execute_2darray_return_value=(True, dict(rows=[])),
|
||||
|
||||
expect_render_template_called_with=dict(
|
||||
template_name_or_list=os.path.join('sql',
|
||||
'#gpdb#80323#',
|
||||
'node.sql'),
|
||||
template_name_or_list=os.path.join(
|
||||
'sql/#gpdb#80323#', 'node.sql'),
|
||||
external_table_id=11
|
||||
),
|
||||
expected_make_json_response_called_with=dict(
|
||||
@@ -240,9 +235,8 @@ class TestExternalTablesView(BaseTestGenerator):
|
||||
)),
|
||||
|
||||
expect_render_template_called_with=dict(
|
||||
template_name_or_list=os.path.join('sql',
|
||||
'#gpdb#80323#',
|
||||
'node.sql'),
|
||||
template_name_or_list=os.path.join(
|
||||
'sql/#gpdb#80323#', 'node.sql'),
|
||||
external_table_id=11
|
||||
),
|
||||
expected_make_json_response_called_with=dict(
|
||||
@@ -297,10 +291,7 @@ class TestExternalTablesView(BaseTestGenerator):
|
||||
|
||||
expect_render_template_called_with=dict(
|
||||
template_name_or_list=os.path.join(
|
||||
'sql',
|
||||
'#gpdb#80323#',
|
||||
'get_table_information.sql'
|
||||
),
|
||||
'sql/#gpdb#80323#', 'get_table_information.sql'),
|
||||
table_oid=11
|
||||
),
|
||||
expected_make_response_called_with=dict(
|
||||
|
||||
@@ -20,7 +20,7 @@ else:
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
|
||||
class TestExternalTablesView(BaseTestGenerator):
|
||||
class TestProperties(BaseTestGenerator):
|
||||
scenarios = [
|
||||
('#properties When retrieving the properties of a external table '
|
||||
'and the table exists, '
|
||||
|
||||
@@ -27,9 +27,7 @@ class TestTemplateCreate(BaseTestGenerator):
|
||||
'when no primary key is present, '
|
||||
'it returns "DISTRIBUTED RANDOMLY"',
|
||||
dict(
|
||||
template_path=os.path.join(
|
||||
'table', 'sql', 'gpdb_5.0_plus', 'create.sql'
|
||||
),
|
||||
template_path='table/sql/gpdb_5.0_plus/create.sql',
|
||||
input_parameters=dict(
|
||||
data=dict()
|
||||
),
|
||||
@@ -43,8 +41,7 @@ class TestTemplateCreate(BaseTestGenerator):
|
||||
'when primary key is present, '
|
||||
'it returns "DISTRIBUTED BY (attr_primary_key)"',
|
||||
dict(
|
||||
template_path=os.path.join(
|
||||
'table', 'sql', 'gpdb_5.0_plus', 'create.sql'),
|
||||
template_path='table/sql/gpdb_5.0_plus/create.sql',
|
||||
input_parameters=dict(
|
||||
data=dict(
|
||||
primary_key=[
|
||||
@@ -69,8 +66,7 @@ class TestTemplateCreate(BaseTestGenerator):
|
||||
'when distribution is present, '
|
||||
'it returns "DISTRIBUTED BY (attr1, attr2, attr4)"',
|
||||
dict(
|
||||
template_path=os.path.join(
|
||||
'table', 'sql', 'gpdb_5.0_plus', 'create.sql'),
|
||||
template_path='table/sql/gpdb_5.0_plus/create.sql',
|
||||
input_parameters=dict(
|
||||
data=dict(
|
||||
distribution=[1, 2, 4],
|
||||
|
||||
Reference in New Issue
Block a user