-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(plsql): fix functions from tests
- Loading branch information
1 parent
403ce15
commit 65635e8
Showing
13 changed files
with
235 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
This file is part of Giswater 3 | ||
The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
This version of Giswater is provided by Giswater Association | ||
*/ | ||
BEGIN; | ||
|
||
-- Suppress NOTICE messages | ||
SET client_min_messages TO WARNING; | ||
|
||
SET search_path = "SCHEMA_NAME", public, pg_catalog; | ||
|
||
-- Plan for 1 test | ||
SELECT plan(1); | ||
|
||
-- Previous inserts before test | ||
INSERT INTO om_mincut VALUES (-9); | ||
|
||
-- Extract and test the "status" field from the function's JSON response | ||
SELECT is ( | ||
(gw_fct_getmincut($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, | ||
"data":{"filterFields":{}, "pageInfo":{}, "mincutId":"-9"}}$$)::JSON)->>'status', | ||
'Accepted', | ||
'Check if gw_fct_getmincut returns status "Accepted"' | ||
); | ||
|
||
-- Finish the test | ||
SELECT finish(); | ||
|
||
ROLLBACK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
This file is part of Giswater 3 | ||
The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
This version of Giswater is provided by Giswater Association | ||
*/ | ||
BEGIN; | ||
|
||
-- Suppress NOTICE messages | ||
SET client_min_messages TO WARNING; | ||
|
||
SET search_path = "SCHEMA_NAME", public, pg_catalog; | ||
|
||
-- Plan for 1 test | ||
SELECT plan(1); | ||
|
||
-- Extract and test the "status" field from the function's JSON response | ||
SELECT is ( | ||
(gw_fct_getprint($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, | ||
"data":{"filterFields":{}, "pageInfo":{}, "composers":"{composer_plan, composer_mincut}"}}$$)::JSON)->>'status', | ||
'Accepted', | ||
'Check if gw_fct_getprint returns status "Accepted"' | ||
); | ||
|
||
-- Finish the test | ||
SELECT finish(); | ||
|
||
ROLLBACK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
This file is part of Giswater 3 | ||
The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
This version of Giswater is provided by Giswater Association | ||
*/ | ||
BEGIN; | ||
|
||
-- Suppress NOTICE messages | ||
SET client_min_messages TO WARNING; | ||
|
||
SET search_path = "SCHEMA_NAME", public, pg_catalog; | ||
|
||
-- Plan for 1 test | ||
SELECT plan(1); | ||
|
||
-- Extract and test the "status" field from the function's JSON response | ||
SELECT is ( | ||
(gw_fct_getreport($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, | ||
"data":{"filterFields":{}, "pageInfo":{}, "filter":[{"filterName": "Exploitation", "filterValue": "", "filterSign": "="}], | ||
"listId":"101"}}$$)::JSON)->>'status', | ||
'Accepted', | ||
'Check if gw_fct_getreport returns status "Accepted"' | ||
); | ||
|
||
-- Finish the test | ||
SELECT finish(); | ||
|
||
ROLLBACK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
This file is part of Giswater 3 | ||
The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
This version of Giswater is provided by Giswater Association | ||
*/ | ||
BEGIN; | ||
|
||
-- Suppress NOTICE messages | ||
SET client_min_messages TO WARNING; | ||
|
||
SET search_path = "SCHEMA_NAME", public, pg_catalog; | ||
|
||
-- Plan for 1 test | ||
SELECT plan(1); | ||
|
||
-- Extract and test the "status" field from the function's JSON response | ||
SELECT is ( | ||
(gw_fct_setchangevalvestatus($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, | ||
"feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "nodeId":113852, "mincutId":1, "usePsectors":"False"}}$$)::JSON)->>'status', | ||
'Accepted', | ||
'Check if gw_fct_setchangevalvestatus returns status "Accepted"' | ||
); | ||
|
||
-- Finish the test | ||
SELECT finish(); | ||
|
||
ROLLBACK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
This file is part of Giswater 3 | ||
The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
This version of Giswater is provided by Giswater Association | ||
*/ | ||
BEGIN; | ||
|
||
-- Suppress NOTICE messages | ||
SET client_min_messages TO WARNING; | ||
|
||
SET search_path = "SCHEMA_NAME", public, pg_catalog; | ||
|
||
-- Plan for 1 test | ||
SELECT plan(1); | ||
|
||
-- Extract and test the "status" field from the function's JSON response | ||
SELECT is ( | ||
(gw_fct_setcheckproject($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "version":"3.6.012", "fid":101, "initProject":false, "addSchema":"NULL", "mainSchema":"NULL", "projecRole":"role_admin", "infoType":"full", "logFolderVolume":"11.28 MB", "projectType":"ws", "qgisVersion":"3.34.9-Prizren", "osVersion":"Windows 11", "fields":[ {"table_schema":"ws_21_08_2024", "table_id":"v_om_mincut_initpoint", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_om_mincut_valve", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_om_mincut_node", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_om_mincut_connec", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_om_mincut_arc", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_exploitation", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_dma", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_sector", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_dqa", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_presszone", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_node", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_connec", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_arc", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_link", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"ve_pol_connec", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"ve_pol_node", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_dimensions", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_element", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_reservoir", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_tank", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_inlet", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_junction", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_shortpipe", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_valve", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_pump", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_connec", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_pipe", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_virtualvalve", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_inp_virtualpump", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_rpt_node", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_rpt_node", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_rpt_arc", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_rpt_node_all", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_rpt_arc_all", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_rpt_node_hourly", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_rpt_arc_hourly", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_edit_plan_psector", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_plan_current_psector", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_plan_psector_connec", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_plan_psector_node", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_plan_psector_arc", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_plan_psector_link", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"ext_municipality", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_ext_address", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_ext_streetaxis", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ws_21_08_2024", "table_id":"v_ext_plot", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}]}}$$)::JSON)->>'status', | ||
'Accepted', | ||
'Check if gw_fct_getprint returns status "Accepted"' | ||
); | ||
|
||
-- Finish the test | ||
SELECT finish(); | ||
|
||
ROLLBACK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
This file is part of Giswater 3 | ||
The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
This version of Giswater is provided by Giswater Association | ||
*/ | ||
BEGIN; | ||
|
||
-- Suppress NOTICE messages | ||
SET client_min_messages TO WARNING; | ||
|
||
SET search_path = "SCHEMA_NAME", public, pg_catalog; | ||
|
||
-- Plan for 1 test | ||
SELECT plan(1); | ||
|
||
-- Extract and test the "status" field from the function's JSON response | ||
SELECT is ( | ||
(gw_fct_setmincut($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, | ||
"data":{"filterFields":{}, "pageInfo":{}, "action":"mincutNetwork", "mincutId":"-9", "arcId":"2071","usePsectors":"False"}}$$)::JSON)->>'status', | ||
'Accepted', | ||
'Check if gw_fct_setmincut returns status "Accepted"' | ||
); | ||
|
||
-- Finish the test | ||
SELECT finish(); | ||
|
||
ROLLBACK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
This file is part of Giswater 3 | ||
The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
This version of Giswater is provided by Giswater Association | ||
*/ | ||
BEGIN; | ||
|
||
-- Suppress NOTICE messages | ||
SET client_min_messages TO WARNING; | ||
|
||
SET search_path = "SCHEMA_NAME", public, pg_catalog; | ||
|
||
-- Plan for 1 test | ||
SELECT plan(1); | ||
|
||
-- Extract and test the "status" field from the function's JSON response | ||
SELECT is ( | ||
(gw_fct_setprint($${"client":{"device":4, "infoType":1, "lang":"ES"}, "form":{}, "feature":{}, | ||
"data":{"composer": "composer_plan", "scale": 3096, "rotation": 0.0, "title": null, | ||
"ComposerTemplates": [{"ComposerTemplate": "composer_plan", "ComposerMap": [{"width": 65.4621, "height": 46.5539, "name": "Mapa 1", "index": 0}, | ||
{"width": 177.676, "height": 98.32249999694072, "name": "map", "index": 1}]}, | ||
{"ComposerTemplate": "composer_mincut", "ComposerMap": [{"width": 76.7641, "height": 58.44509490998759, "name": "Mapa 2", "index": 0}, | ||
{"width": 179.414, "height": 140.8259999991146, "name": "Mapa", "index": 1}]}], "extent": {"p1": {"xcoord": 418752.6023731107, "ycoord": 4576398.707608407}, | ||
"p2": {"xcoord": 419775.9112769171, "ycoord": 4576688.740716452}}}}$$)::JSON)->>'status', | ||
'Accepted', | ||
'Check if gw_fct_getprint returns status "Accepted"' | ||
); | ||
|
||
-- Finish the test | ||
SELECT finish(); | ||
|
||
ROLLBACK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,6 +130,7 @@ SELECT is ( | |
|
||
|
||
|
||
|
||
-- Finish the test | ||
SELECT finish(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters