Skip to content

Commit 49febe2

Browse files
committed
tests(plsql): fix functions from tests
1 parent 1264ea4 commit 49febe2

10 files changed

+27
-31
lines changed

test/plsql/ud/test_gw_fct_getcatalog.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ SET client_min_messages TO WARNING;
1010

1111
SET search_path = "SCHEMA_NAME", public, pg_catalog;
1212

13-
-- Plan for 1 test
14-
SELECT plan(1);
13+
-- Plan for 2 test
14+
SELECT plan(2);
1515

1616
-- Extract and test the "status" field from the function's JSON response
1717
SELECT is (

test/plsql/ud/test_gw_fct_getconfig.sql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ SELECT is (
2323

2424
SELECT is (
2525
(gw_fct_getconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"config"},
26-
"feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "list_layers_name":"{Node, Connec, Gully, Arc, Link, Node polygon,
27-
Gully polygon, Connec polygon, Dimensioning, Element, Municipality, Streetaxis, Plot}", "list_tables_name":"{v_edit_node,
28-
v_edit_connec, v_edit_gully, v_edit_arc, v_edit_link, ve_pol_node, ve_pol_gully, ve_pol_connec, v_edit_dimensions, v_edit_element,
29-
ext_municipality, v_ext_streetaxis, v_ext_plot}"}}$$)::JSON)->>'status',
26+
"feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "list_layers_name":"{Node, Connec, Gully, Arc, Link, Node polygon, Gully polygon, Connec polygon, Dimensioning, Element, Municipality, Streetaxis, Plot}",
27+
"list_tables_name":"{v_edit_node, v_edit_connec, v_edit_gully, v_edit_arc, v_edit_link, ve_pol_node, ve_pol_gully, ve_pol_connec, v_edit_dimensions, v_edit_element, ext_municipality, v_ext_streetaxis, v_ext_plot}"}}$$)::JSON)->>'status',
3028
'Accepted',
3129
'Check if gw_fct_getconfig --> "formName":"config" returns status "Accepted"'
3230
);

test/plsql/ud/test_gw_fct_getinfofromid.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ SET client_min_messages TO WARNING;
1111
SET search_path = "SCHEMA_NAME", public, pg_catalog;
1212

1313
-- TODO: Add test for gw_fct_getinfofromid
14-
-- -- Plan for 6 test
15-
-- SELECT plan(6);
14+
-- Plan for 6 test
15+
SELECT plan(0);
1616

1717
-- -- Extract and test the "status" field from the function's JSON response
1818
-- SELECT is(

test/plsql/ud/test_gw_fct_getprocess.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ SET client_min_messages TO WARNING;
1010

1111
SET search_path = "SCHEMA_NAME", public, pg_catalog;
1212

13-
-- Plan for 1 test
14-
SELECT plan(1);
13+
-- Plan for 2 test
14+
SELECT plan(2);
1515

1616
-- Extract and test the "status" field from the function's JSON response
1717
SELECT is (

test/plsql/ud/test_gw_fct_getselectors.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ SET client_min_messages TO WARNING;
1010

1111
SET search_path = "SCHEMA_NAME", public, pg_catalog;
1212

13-
-- Plan for 2 test
14-
SELECT plan(2);
13+
-- Plan for 3 test
14+
SELECT plan(3);
1515

1616
-- Extract and test the "status" field from the function's JSON response
1717
SELECT is (

test/plsql/ud/test_gw_fct_setlinktonetwork.sql

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@ SET client_min_messages TO WARNING;
1010

1111
SET search_path = "SCHEMA_NAME", public, pg_catalog;
1212

13+
-- Plan for 1 test
1314
SELECT plan(1);
14-
SELECT ok(1=1, 'One equals one');
15+
16+
-- Extract and test the "status" field from the function's JSON response
17+
SELECT is (
18+
(gw_fct_setlinktonetwork($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{},
19+
"feature":{"id":"[3095, 3094, 3091, 3090]"}, "data":{"filterFields":{}, "pageInfo":{}, "feature_type":"CONNEC"}}$$)::JSON)->>'status',
20+
'Accepted',
21+
'Check if gw_fct_setlinktonetwork returns status "Accepted"'
22+
);
1523

1624
-- TODO
1725
-- gw_fct_setlinktonetwork
@@ -29,4 +37,4 @@ SELECT ok(1=1, 'One equals one');
2937
-- Finish the test
3038
SELECT finish();
3139

32-
ROLLBACK;
40+
ROLLBACK;

test/plsql/ws/test_gw_fct_config_mapzones.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ SET client_min_messages TO WARNING;
1010

1111
SET search_path = "SCHEMA_NAME", public, pg_catalog;
1212

13-
-- Plan for 5 test
14-
SELECT plan(5);
13+
-- Plan for 1 test
14+
SELECT plan(1);
1515

1616
-- Extract and test the "status" field from the function's JSON response
1717
SELECT is (

test/plsql/ws/test_gw_fct_getconfig.sql

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,7 @@ SELECT is (
2323

2424
SELECT is (
2525
(gw_fct_getconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"config"},
26-
"feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "list_layers_name":"{Mincut init point, Mincut result valve,
27-
Mincut result node, Mincut result connec, Mincut result arc, Node, Connec, Arc, Link, Connec polygon, Node polygon,
28-
Dimensioning, Inp reservoir, Inp tank, Inp inlet, Inp junction, Inp shortpipe, Inp valve, Inp pump, Inp connec, Inp pipe,
29-
Inp virtualvalve, Inp virtualpump, Plan psector connec, Plan psector node, Plan psector arc, Plan psector link, Municipality,
30-
Streetaxis, Plot}", "list_tables_name":"{v_om_mincut_initpoint, v_om_mincut_valve, v_om_mincut_node, v_om_mincut_connec,
31-
v_om_mincut_arc, v_edit_node, v_edit_connec, v_edit_arc, v_edit_link, ve_pol_connec, ve_pol_node, v_edit_dimensions,
32-
v_edit_inp_reservoir, v_edit_inp_tank, v_edit_inp_inlet, v_edit_inp_junction, v_edit_inp_shortpipe, v_edit_inp_valve,
33-
v_edit_inp_pump, v_edit_inp_connec, v_edit_inp_pipe, v_edit_inp_virtualvalve, v_edit_inp_virtualpump, v_plan_psector_connec,
34-
v_plan_psector_node, v_plan_psector_arc, v_plan_psector_link, ext_municipality, v_ext_streetaxis, v_ext_plot}"}}$$)::JSON)->>'status',
35-
'Accepted',
26+
"feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "list_layers_name":"{Mincut init point, Mincut result valve, Mincut result node, Mincut result connec, Mincut result arc, Node, Connec, Arc, Link, Connec polygon, Node polygon, Dimensioning, Inp reservoir, Inp tank, Inp inlet, Inp junction, Inp shortpipe, Inp valve, Inp pump, Inp connec, Inp pipe, Inp virtualvalve, Inp virtualpump, Plan psector connec, Plan psector node, Plan psector arc, Plan psector link, Municipality, Streetaxis, Plot}", "list_tables_name":"{v_om_mincut_initpoint, v_om_mincut_valve, v_om_mincut_node, v_om_mincut_connec, v_om_mincut_arc, v_edit_node, v_edit_connec, v_edit_arc, v_edit_link, ve_pol_connec, ve_pol_node, v_edit_dimensions, v_edit_inp_reservoir, v_edit_inp_tank, v_edit_inp_inlet, v_edit_inp_junction, v_edit_inp_shortpipe, v_edit_inp_valve, v_edit_inp_pump, v_edit_inp_connec, v_edit_inp_pipe, v_edit_inp_virtualvalve, v_edit_inp_virtualpump, v_plan_psector_connec, v_plan_psector_node, v_plan_psector_arc, v_plan_psector_link, ext_municipality, v_ext_streetaxis, v_ext_plot}"}}$$)::JSON)->>'status','Accepted',
3627
'Check if gw_fct_getconfig --> "formName":"config" returns status "Accepted"'
3728
);
3829

test/plsql/ws/test_gw_fct_getlist.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ SET client_min_messages TO WARNING;
1010

1111
SET search_path = "SCHEMA_NAME", public, pg_catalog;
1212

13-
-- Plan for 4 test
14-
SELECT plan(4);
13+
-- Plan for 7 test
14+
SELECT plan(7);
1515

1616
-- Extract and test the "status" field from the function's JSON response
1717
SELECT is (

test/plsql/ws/test_gw_fct_setlinktonetwork.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ SELECT plan(1);
1515

1616
-- Extract and test the "status" field from the function's JSON response
1717
SELECT is (
18-
(gw_fct_setlinktonetwork($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{},
19-
"feature":{"id":"[114282, 114283, 114284, 114285, 114286, 114287, 114335, 114336, 114337, 114338, 114339, 114463, 3019, 3020, 3028]"},
18+
(gw_fct_setlinktonetwork($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"id":"[3099, 3098, 3101]"},
2019
"data":{"filterFields":{}, "pageInfo":{}, "feature_type":"CONNEC"}}$$)::JSON)->>'status',
2120
'Accepted',
2221
'Check if gw_fct_setlinktonetwork returns status "Accepted"'
@@ -38,4 +37,4 @@ SELECT is (
3837
-- Finish the test
3938
SELECT finish();
4039

41-
ROLLBACK;
40+
ROLLBACK;

0 commit comments

Comments
 (0)