mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Add a framework for testing reversed engineered SQL and CRUD API endpoints. Fixes #4202
This commit is contained in:
@@ -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';
|
||||
@@ -0,0 +1,7 @@
|
||||
-- Cast: money -> bigint
|
||||
|
||||
-- DROP CAST (money AS bigint);
|
||||
|
||||
CREATE CAST (money AS bigint)
|
||||
WITHOUT FUNCTION
|
||||
AS IMPLICIT;
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -11,6 +11,5 @@ from pgadmin.utils.route import BaseTestGenerator
|
||||
|
||||
|
||||
class CollationTestGenerator(BaseTestGenerator):
|
||||
|
||||
def generate_tests(self):
|
||||
def runTest(self):
|
||||
return
|
||||
|
||||
@@ -11,6 +11,5 @@ from pgadmin.utils.route import BaseTestGenerator
|
||||
|
||||
|
||||
class SynonymTestGenerator(BaseTestGenerator):
|
||||
|
||||
def generate_tests(self):
|
||||
def runTest(self):
|
||||
return
|
||||
|
||||
@@ -11,6 +11,5 @@ from pgadmin.utils.route import BaseTestGenerator
|
||||
|
||||
|
||||
class ViewsTestGenerator(BaseTestGenerator):
|
||||
|
||||
def generate_tests(self):
|
||||
def runTest(self):
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user