Skip to content
Permalink
Browse files

Add unit test for with_geometry and json export

  • Loading branch information
pblottiere committed Jan 18, 2019
1 parent ebd1022 commit 45399d72b438f58e3c0791db0259cc0e671522b3
@@ -424,7 +424,7 @@ def testGetFeatureInfoTolerance(self):
'test_project_values.qgz')

def testGetFeatureInfoJSON(self):
# simple test
# simple test without geometry
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
'info_format=application%2Fjson&transparent=true&' +
@@ -433,6 +433,16 @@ def testGetFeatureInfoJSON(self):
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320',
'wms_getfeatureinfo_json')

# simple test with geometry
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
'info_format=application%2Fjson&transparent=true&' +
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320&' +
'with_geometry=true',
'wms_getfeatureinfo_geometry_json')

# test with alias
self.wms_request_compare('GetFeatureInfo',
'&layers=fields_alias&styles=&' +
@@ -6,8 +6,7 @@ Content-Type: application/json; charset=utf-8
{
"type":"Feature",
"id":2,
"geometry":
{"type": "Point", "coordinates": [8.203459, 44.901395]},
"geometry":null,
"properties":{
"alias_id":3,
"alias_name":"three",
@@ -6,8 +6,7 @@ Content-Type: application/json; charset=utf-8
{
"type":"Feature",
"id":2,
"geometry":
{"type": "Point", "coordinates": [8.203459, 44.901395]},
"geometry":null,
"properties":{
"id":3,
"utf8nameè":"three èé↓"
@@ -0,0 +1,17 @@
*****
Content-Type: application/json; charset=utf-8

{ "type": "FeatureCollection",
"features":[
{
"type":"Feature",
"id":2,
"geometry":
{"type": "Point", "coordinates": [8.203459, 44.901395]},
"properties":{
"id":3,
"name":"three",
"utf8nameè":"three èé↓"
}
}
]}
@@ -6,8 +6,7 @@ Content-Type: application/json; charset=utf-8
{
"type":"Feature",
"id":2,
"geometry":
{"type": "Point", "coordinates": [8.203459, 44.901395]},
"geometry":null,
"properties":{
"id":3,
"name":"three",

0 comments on commit 45399d7

Please sign in to comment.
You can’t perform that action at this time.