Skip to content

Commit

Permalink
tests(plsql): add function getfeaturegeom in ud and setarcfusion in both
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez-bgeo committed Aug 22, 2024
1 parent 12aed73 commit 11a4171
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
27 changes: 27 additions & 0 deletions test/plsql/ud/test_gw_fct_getfeaturegeom.sql
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_getfeaturegeom($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{},
"feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "feature_type": "arc", "ids": "[20608, 157]"}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_getfeaturegeom returns status "Accepted"'
);

-- Finish the test
SELECT finish();

ROLLBACK;
12 changes: 9 additions & 3 deletions test/plsql/ud/test_gw_fct_setarcfusion.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ SET client_min_messages TO WARNING;

SET search_path = "SCHEMA_NAME", public, pg_catalog;

-- Plan for 1 test
SELECT plan(1);
SELECT ok(1=1, 'One equals one');

-- TODO
-- gw_fct_setarcdivide
-- Extract and test the "status" field from the function's JSON response
SELECT is (
(gw_fct_setarcfusion($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{},
"feature":{"id":["82"]}, "data":{"filterFields":{}, "pageInfo":{}, "enddate":"2024-08-22",
"workcatId":"work1", "action_mode": 0}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_setcatalog returns status "Accepted"'
);

-- Finish the test
SELECT finish();
Expand Down
11 changes: 8 additions & 3 deletions test/plsql/ws/test_gw_fct_setarcfusion.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ SET client_min_messages TO WARNING;

SET search_path = "SCHEMA_NAME", public, pg_catalog;

-- Plan for 1 test
SELECT plan(1);
SELECT ok(1=1, 'One equals one');

-- TODO
-- gw_fct_setarcfusion
-- Extract and test the "status" field from the function's JSON response
SELECT is (
(gw_fct_setarcfusion($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"id":["113852"]}, "data":{"filterFields":{},
"pageInfo":{}, "enddate":"2024-08-22", "workcatId":"work1", "action_mode": 0}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_setcatalog returns status "Accepted"'
);

-- Finish the test
SELECT finish();
Expand Down

0 comments on commit 11a4171

Please sign in to comment.