Skip to content

Commit 2f683fc

Browse files
committedJan 28, 2019
Add unit test with multiple layers and features for json
1 parent 5ef1139 commit 2f683fc

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
 

‎tests/src/python/test_qgsserver_wms_getfeatureinfo.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,16 @@ def testGetFeatureInfoJSON(self):
442442
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320',
443443
'wms_getfeatureinfo_json')
444444

445+
# test with several features and several layers
446+
self.wms_request_compare('GetFeatureInfo',
447+
'&layers=testlayer%20%C3%A8%C3%A9,fields_alias,exclude_attribute&styles=&' +
448+
'info_format=application%2Fjson&transparent=true&' +
449+
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
450+
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +
451+
'query_layers=testlayer%20%C3%A8%C3%A9,fields_alias,exclude_attribute&' +
452+
'X=190&Y=320&FEATURE_COUNT=2&FI_POINT_TOLERANCE=200',
453+
'wms_getfeatureinfo_multiple_json')
454+
445455
# simple test with geometry
446456
self.wms_request_compare('GetFeatureInfo',
447457
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
*****
2+
Content-Type: application/json; charset=utf-8
3+
4+
{"layers":[{
5+
"name": "testlayer èé",
6+
"type": "FeatureCollection",
7+
"features":[
8+
{
9+
"type":"Feature",
10+
"id":0,
11+
"geometry":null,
12+
"properties":{
13+
"id":1,
14+
"name":"one",
15+
"utf8nameè":"one èé"
16+
}
17+
},
18+
{
19+
"type":"Feature",
20+
"id":1,
21+
"geometry":null,
22+
"properties":{
23+
"id":2,
24+
"name":"two",
25+
"utf8nameè":"two àò"
26+
}
27+
}
28+
]},{
29+
"name": "fields_alias",
30+
"type": "FeatureCollection",
31+
"features":[
32+
{
33+
"type":"Feature",
34+
"id":0,
35+
"geometry":null,
36+
"properties":{
37+
"alias_id":1,
38+
"alias_name":"one",
39+
"utf8nameè":"one èé"
40+
}
41+
},
42+
{
43+
"type":"Feature",
44+
"id":1,
45+
"geometry":null,
46+
"properties":{
47+
"alias_id":2,
48+
"alias_name":"two",
49+
"utf8nameè":"two àò"
50+
}
51+
}
52+
]},{
53+
"name": "exclude_attribute",
54+
"type": "FeatureCollection",
55+
"features":[
56+
{
57+
"type":"Feature",
58+
"id":0,
59+
"geometry":null,
60+
"properties":{
61+
"id":1,
62+
"utf8nameè":"one èé"
63+
}
64+
},
65+
{
66+
"type":"Feature",
67+
"id":1,
68+
"geometry":null,
69+
"properties":{
70+
"id":2,
71+
"utf8nameè":"two àò"
72+
}
73+
}
74+
]}]}

0 commit comments

Comments
 (0)
Please sign in to comment.