Skip to content

Commit

Permalink
address comments and add @unittest.expectedFailure to test
Browse files Browse the repository at this point in the history
  • Loading branch information
tudorbarascu committed May 8, 2018
1 parent 27b4170 commit 90355f0
Showing 1 changed file with 55 additions and 49 deletions.
104 changes: 55 additions & 49 deletions tests/src/python/test_qgsserver_wms_getfeatureinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def testGetFeatureInfo(self):
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320',
'wms_getfeatureinfo-text-html')

#Test getfeatureinfo response html with geometry
# Test getfeatureinfo response html with geometry
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
'info_format=text%2Fhtml&transparent=true&' +
Expand All @@ -76,7 +76,7 @@ def testGetFeatureInfo(self):
'with_geometry=true',
'wms_getfeatureinfo-text-html-geometry')

#Test getfeatureinfo response html with maptip
# Test getfeatureinfo response html with maptip
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
'info_format=text%2Fhtml&transparent=true&' +
Expand Down Expand Up @@ -181,53 +181,59 @@ def testGetFeatureInfo(self):
'wms_getfeatureinfo-values1-text-xml',
'test_project_values.qgs')

# Test GetFeatureInfo resolves "value relation" widget values
# TODO fix regression and enable test
# mypath = self.testdata_path + "test_project_values.qgs"
# self.wms_request_compare('GetFeatureInfo',
# '&layers=layer1&styles=&' +
# 'VERSION=1.3.0&' +
# 'info_format=text%2Fxml&' +
# 'width=926&height=787&srs=EPSG%3A4326' +
# '&bbox=912217,5605059,914099,5606652' +
# '&CRS=EPSG:3857' +
# '&FEATURE_COUNT=10' +
# '&WITH_GEOMETRY=True' +
# '&QUERY_LAYERS=layer1&I=487&J=308',
# 'wms_getfeatureinfo-values1-text-xml',
# 'test_project_values.qgs')

# Test GetFeatureInfo on "value relation" widget with array field (multiple selections)
# TODO make GetFeatureInfo show the dictionary values and enable test
# mypath = self.testdata_path + "test_project_values.qgs"
# self.wms_request_compare('GetFeatureInfo',
# '&layers=layer3&styles=&' +
# 'VERSION=1.3.0&' +
# 'info_format=text%2Fxml&' +
# 'width=926&height=787&srs=EPSG%3A4326' +
# '&bbox=912217,5605059,914099,5606652' +
# '&CRS=EPSG:3857' +
# '&FEATURE_COUNT=10' +
# '&WITH_GEOMETRY=True' +
# '&QUERY_LAYERS=layer3&I=487&J=308',
# 'wms_getfeatureinfo-values3-text-xml',
# 'test_project_values.qgs')

# Test GetFeatureInfo resolves "relation reference" widget "display expression" values
# TODO make GetFeatureInfo show what's in the display expression and enable test
# mypath = self.testdata_path + "test_project_values.qgs"
# self.wms_request_compare('GetFeatureInfo',
# '&layers=layer2&styles=&' +
# 'VERSION=1.3.0&' +
# 'info_format=text%2Fxml&' +
# 'width=926&height=787&srs=EPSG%3A4326' +
# '&bbox=912217,5605059,914099,5606652' +
# '&CRS=EPSG:3857' +
# '&FEATURE_COUNT=10' +
# '&WITH_GEOMETRY=True' +
# '&QUERY_LAYERS=layer2&I=487&J=308',
# 'wms_getfeatureinfo-values2-text-xml',
# 'test_project_values.qgs')
# TODO fix regression in QGIS 3 as the widget values don't get solved and enable test
@unittest.expectedFailure
def testGetFeatureInfoValueRelation(self):
"""Test GetFeatureInfo resolves "value relation" widget values"""
mypath = self.testdata_path + "test_project_values.qgs"
self.wms_request_compare('GetFeatureInfo',
'&layers=layer1&styles=&' +
'VERSION=1.3.0&' +
'info_format=text%2Fxml&' +
'width=926&height=787&srs=EPSG%3A4326' +
'&bbox=912217,5605059,914099,5606652' +
'&CRS=EPSG:3857' +
'&FEATURE_COUNT=10' +
'&WITH_GEOMETRY=True' +
'&QUERY_LAYERS=layer1&I=487&J=308',
'wms_getfeatureinfo-values1-text-xml',
'test_project_values.qgs')

# 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"
self.wms_request_compare('GetFeatureInfo',
'&layers=layer3&styles=&' +
'VERSION=1.3.0&' +
'info_format=text%2Fxml&' +
'width=926&height=787&srs=EPSG%3A4326' +
'&bbox=912217,5605059,914099,5606652' +
'&CRS=EPSG:3857' +
'&FEATURE_COUNT=10' +
'&WITH_GEOMETRY=True' +
'&QUERY_LAYERS=layer3&I=487&J=308',
'wms_getfeatureinfo-values3-text-xml',
'test_project_values.qgs')

# 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"
self.wms_request_compare('GetFeatureInfo',
'&layers=layer2&styles=&' +
'VERSION=1.3.0&' +
'info_format=text%2Fxml&' +
'width=926&height=787&srs=EPSG%3A4326' +
'&bbox=912217,5605059,914099,5606652' +
'&CRS=EPSG:3857' +
'&FEATURE_COUNT=10' +
'&WITH_GEOMETRY=True' +
'&QUERY_LAYERS=layer2&I=487&J=308',
'wms_getfeatureinfo-values2-text-xml',
'test_project_values.qgs')

def testGetFeatureInfoFilter(self):
# Test getfeatureinfo response xml
Expand Down

0 comments on commit 90355f0

Please sign in to comment.