Add a framework for testing reversed engineered SQL and CRUD API endpoints. Fixes #4202

This commit is contained in:
Akshay Joshi
2019-06-18 14:28:25 +01:00
committed by Dave Page
parent 71919a4ce9
commit 9e65c971a3
14 changed files with 359 additions and 15 deletions

View File

@@ -0,0 +1,9 @@
-- Cast: money -> bigint
-- DROP CAST (money AS bigint);
CREATE CAST (money AS bigint)
WITHOUT FUNCTION
AS IMPLICIT;
COMMENT ON CAST (money AS bigint) IS 'Cast from money to bigint';

View File

@@ -0,0 +1,7 @@
-- Cast: money -> bigint
-- DROP CAST (money AS bigint);
CREATE CAST (money AS bigint)
WITHOUT FUNCTION
AS IMPLICIT;

View File

@@ -0,0 +1,68 @@
{
"scenarios": [
{
"type": "create",
"name": "Create IMPLICIT Cast",
"endpoint": "NODE-cast.obj",
"sql_endpoint": "NODE-cast.sql_id",
"data": {
"castcontext": "IMPLICIT",
"encoding": "UTF8",
"name": "money->bigint",
"srctyp": "money",
"trgtyp": "bigint"
},
"expected_sql_file": "create_implicit_cast.sql"
},
{
"type": "alter",
"name": "Alter IMPLICIT Cast",
"endpoint": "NODE-cast.obj_id",
"sql_endpoint": "NODE-cast.sql_id",
"data": {
"description": "Cast from money to bigint"
},
"expected_sql_file": "alter_implicit_cast.sql"
},
{
"type": "delete",
"name": "Drop IMPLICIT Cast",
"endpoint": "NODE-cast.delete_id",
"data": {
"name": "money->bigint"
}
},
{
"type": "create",
"name":"Create EXPLICIT Cast",
"endpoint": "NODE-cast.obj",
"sql_endpoint": "NODE-cast.sql_id",
"data": {
"castcontext": "EXPLICIT",
"encoding": "UTF8",
"name": "money->bigint",
"srctyp": "money",
"trgtyp": "bigint"
},
"expected_sql": "-- Cast: money -> bigint\n\n-- DROP CAST (money AS bigint);\n\nCREATE CAST (money AS bigint)\n\tWITHOUT FUNCTION;"
},
{
"type": "alter",
"name": "Alter EXPLICIT Cast",
"endpoint": "NODE-cast.obj_id",
"sql_endpoint": "NODE-cast.sql_id",
"data": {
"description": "Cast from money to bigint"
},
"expected_sql": "-- Cast: money -> bigint\n\n-- DROP CAST (money AS bigint);\n\nCREATE CAST (money AS bigint)\n\tWITHOUT FUNCTION;\n\nCOMMENT ON CAST (money AS bigint) IS 'Cast from money to bigint';"
},
{
"type": "delete",
"name": "Drop EXPLICIT Cast",
"endpoint": "NODE-cast.delete_id",
"data": {
"name": "money->bigint"
}
}
]
}

View File

@@ -11,6 +11,5 @@ from pgadmin.utils.route import BaseTestGenerator
class CollationTestGenerator(BaseTestGenerator):
def generate_tests(self):
def runTest(self):
return

View File

@@ -11,6 +11,5 @@ from pgadmin.utils.route import BaseTestGenerator
class SynonymTestGenerator(BaseTestGenerator):
def generate_tests(self):
def runTest(self):
return

View File

@@ -11,6 +11,5 @@ from pgadmin.utils.route import BaseTestGenerator
class ViewsTestGenerator(BaseTestGenerator):
def generate_tests(self):
def runTest(self):
return