Skip to content

Commit

Permalink
Merge pull request #7279 from tudorbarascu/tests
Browse files Browse the repository at this point in the history
rework server test to use geopackage and qgz
  • Loading branch information
elpaso authored Jul 17, 2018
2 parents d27c1aa + deb9f59 commit 3d20cfe
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 1,693 deletions.
33 changes: 24 additions & 9 deletions tests/src/python/test_qgsserver_wms_getfeatureinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def testGetFeatureInfo(self):
'wms_getfeatureinfo_notvisible',
'test_project_scalevisibility.qgs')

# Test GetFeatureInfo resolves "value map" widget values
mypath = self.testdata_path + "test_project_values.qgs"
# Test GetFeatureInfo resolves "value map" widget values but also Server usage of qgs and gpkg file
mypath = self.testdata_path + "test_project_values.qgz"
self.wms_request_compare('GetFeatureInfo',
'&layers=layer0&styles=&' +
'VERSION=1.3.0&' +
Expand All @@ -179,11 +179,11 @@ def testGetFeatureInfo(self):
'&FEATURE_COUNT=10' +
'&QUERY_LAYERS=layer0&I=487&J=308',
'wms_getfeatureinfo-values0-text-xml',
'test_project_values.qgs')
'test_project_values.qgz')

def testGetFeatureInfoValueRelation(self):
"""Test GetFeatureInfo resolves "value relation" widget values. regression 18518"""
mypath = self.testdata_path + "test_project_values.qgs"
mypath = self.testdata_path + "test_project_values.qgz"
self.wms_request_compare('GetFeatureInfo',
'&layers=layer1&styles=&' +
'VERSION=1.3.0&' +
Expand All @@ -195,13 +195,13 @@ def testGetFeatureInfoValueRelation(self):
'&WITH_GEOMETRY=True' +
'&QUERY_LAYERS=layer1&I=487&J=308',
'wms_getfeatureinfo-values1-text-xml',
'test_project_values.qgs')
'test_project_values.qgz')

# TODO make GetFeatureInfo show the dictionary values and enable test
@unittest.expectedFailure
def testGetFeatureInfoValueRelationArray(self):
"""Test GetFeatureInfo on "value relation" widget with array field (multiple selections)"""
mypath = self.testdata_path + "test_project_values.qgs"
mypath = self.testdata_path + "test_project_values.qgz"
self.wms_request_compare('GetFeatureInfo',
'&layers=layer3&styles=&' +
'VERSION=1.3.0&' +
Expand All @@ -213,13 +213,13 @@ def testGetFeatureInfoValueRelationArray(self):
'&WITH_GEOMETRY=True' +
'&QUERY_LAYERS=layer3&I=487&J=308',
'wms_getfeatureinfo-values3-text-xml',
'test_project_values.qgs')
'test_project_values.qgz')

# TODO make GetFeatureInfo show what's in the display expression and enable test
@unittest.expectedFailure
def testGetFeatureInfoRelationReference(self):
"""Test GetFeatureInfo solves "relation reference" widget "display expression" values"""
mypath = self.testdata_path + "test_project_values.qgs"
mypath = self.testdata_path + "test_project_values.qgz"
self.wms_request_compare('GetFeatureInfo',
'&layers=layer2&styles=&' +
'VERSION=1.3.0&' +
Expand All @@ -231,7 +231,22 @@ def testGetFeatureInfoRelationReference(self):
'&WITH_GEOMETRY=True' +
'&QUERY_LAYERS=layer2&I=487&J=308',
'wms_getfeatureinfo-values2-text-xml',
'test_project_values.qgs')
'test_project_values.qgz')

# TODO make filter work with gpkg and move test inside testGetFeatureInfoFilter function
@unittest.expectedFailure
def testGetFeatureInfoFilterGPKG(self):
# 'test_project.qgz' ='test_project.qgs' but with a gpkg source + different fid
# Regression for #8656 Test getfeatureinfo response xml with gpkg datasource
# Mind the gap! (the space in the FILTER expression)
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&' +
'INFO_FORMAT=text%2Fxml&' +
'width=600&height=400&srs=EPSG%3A3857&' +
'query_layers=testlayer%20%C3%A8%C3%A9&' +
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.parse.quote(':"NAME" = \'two\''),
'wms_getfeatureinfo_filter_gpkg',
'test_project.qgz')

def testGetFeatureInfoFilter(self):
# Test getfeatureinfo response xml
Expand Down
Binary file added tests/testdata/qgis_server/db.gpkg
Binary file not shown.
Binary file added tests/testdata/qgis_server/test_project.qgz
Binary file not shown.
Loading

0 comments on commit 3d20cfe

Please sign in to comment.