@@ -10,23 +10,48 @@ SET client_min_messages TO WARNING;
10
10
11
11
SET search_path = " SCHEMA_NAME" , public, pg_catalog;
12
12
13
- -- Plan for 2 test
14
- SELECT plan(2 );
13
+ -- Plan for 5 test
14
+ SELECT plan(5 );
15
15
16
16
-- Extract and test the "status" field from the function's JSON response
17
17
SELECT is (
18
- (gw_fct_getprofile($${" client" :{" device" :4 , " lang" :" es_ES" , " infoType" :1 , " epsg" :25831 }, " form" :{}, " feature" :{},
19
- " data" :{" filterFields" :{}, " pageInfo" :{}}}$$)::JSON)- >> ' status' ,
18
+ (gw_fct_config_mapzones($${" client" :{" device" :4 , " lang" :" NULL" , " infoType" :1 , " epsg" :25831 }, " form" :{}, " feature" :{}, " data" :{" filterFields" :{}, " pageInfo" :{},
19
+ " parameters" : {" action" : " UPDATE" , " configZone" : " drainzone" , " mapzoneId" : " -1" ,
20
+ " config" : {" use" :[{" nodeParent" :" " }], " ignore" :[], " forceClosed" :[]}}}}$$)::JSON)- >> ' status' ,
20
21
' Accepted' ,
21
- ' Check if gw_fct_getprofile returns status "Accepted"'
22
+ ' Check if gw_fct_config_mapzones with action "UPDATE" returns status "Accepted"'
22
23
);
23
24
24
25
SELECT is (
25
- (gw_fct_config_mapzones($${" client" :{" device" :4 , " lang" :" es_ES " , " infoType" :1 , " epsg" :25831 }, " form" :{}, " feature" :{},
26
- " data " :{ " filterFields " :{} , " pageInfo " :{} , " parameters " : { " action " : " UPDATE " , " configZone " : " drainzone " ,
27
- " mapzoneId " : " -1 " , " config " : { " use " :[{ " nodeParent " : " " }], " ignore " :[], " forceClosed" :[]}}}}$$)::JSON)- >> ' status' ,
26
+ (gw_fct_config_mapzones($${" client" :{" device" :4 , " lang" :" NULL " , " infoType" :1 , " epsg" :25831 }, " form" :{}, " feature" :{}, " data " :{ " filterFields " :{}, " pageInfo " :{},
27
+ " parameters " : { " action " : " ADD " , " configZone " : " drainzone " , " mapzoneId " : " -1 " , " nodeParent " : " 82 " , " toArc " : [], " config " : { " use " :[{ " nodeParent " : " " }], " ignore " :[] ,
28
+ " forceClosed" :[]}}}}$$)::JSON)- >> ' status' ,
28
29
' Accepted' ,
29
- ' Check if gw_fct_getprofile with parameters returns status "Accepted"'
30
+ ' Check if gw_fct_config_mapzones with action "ADD" and 4th parameter is "nodeParent" returns status "Accepted"'
31
+ );
32
+
33
+ SELECT is (
34
+ (gw_fct_config_mapzones($${" client" :{" device" :4 , " lang" :" NULL" , " infoType" :1 , " epsg" :25831 }, " form" :{}, " feature" :{}, " data" :{" filterFields" :{}, " pageInfo" :{},
35
+ " parameters" : {" action" : " ADD" , " configZone" : " drainzone" , " mapzoneId" : " -1" , " forceClosed" : [" 82" ], " config" : {" use" : [{" nodeParent" : " 82" }], " ignore" : [],
36
+ " forceClosed" : []}}}}$$)::JSON)- >> ' status' ,
37
+ ' Accepted' ,
38
+ ' Check if gw_fct_config_mapzones with action "ADD" and 4th parameter is "forceClosed" returns status "Accepted"'
39
+ );
40
+
41
+ SELECT is (
42
+ (gw_fct_config_mapzones($${" client" :{" device" :4 , " lang" :" NULL" , " infoType" :1 , " epsg" :25831 }, " form" :{}, " feature" :{}, " data" :{" filterFields" :{}, " pageInfo" :{},
43
+ " parameters" : {" action" : " REMOVE" , " configZone" : " drainzone" , " mapzoneId" : " -1" , " nodeParent" : " 82" , " config" : {" use" : [{" nodeParent" : " 82" }], " ignore" : [],
44
+ " forceClosed" : []}}}}$$)::JSON)- >> ' status' ,
45
+ ' Accepted' ,
46
+ ' Check if gw_fct_config_mapzones with action "REMOVE" and 4th parameter is "nodeParent" returns status "Accepted"'
47
+ );
48
+
49
+ SELECT is (
50
+ (gw_fct_config_mapzones($${" client" :{" device" :4 , " lang" :" NULL" , " infoType" :1 , " epsg" :25831 }, " form" :{}, " feature" :{}, " data" :{" filterFields" :{}, " pageInfo" :{},
51
+ " parameters" : {" action" : " REMOVE" , " configZone" : " drainzone" , " mapzoneId" : " -1" , " forceClosed" : [" 82" ],
52
+ " config" : {" use" : [{" nodeParent" : " 82" }], " ignore" : [], " forceClosed" : [82 ]}}}}$$)::JSON)- >> ' status' ,
53
+ ' Accepted' ,
54
+ ' Check if gw_fct_config_mapzones with action "REMOVE" and 4th parameter is "forceClosed" returns status "Accepted"'
30
55
);
31
56
32
57
-- Finish the test
0 commit comments