Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add test to ensure server throws exception if layer is invalid
  • Loading branch information
mhugent committed Jan 22, 2019
1 parent ffae79b commit 80e7534
Show file tree
Hide file tree
Showing 2 changed files with 1,964 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/src/python/test_qgsserver_wms_getmap.py
Expand Up @@ -1375,6 +1375,29 @@ def test_wms_getmap_group_regression_20810(self):
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_GroupedLayersDown")

def test_wms_getmap_datasource_error(self):
"""Must throw a server exception if datasource if not available"""
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(os.path.join(self.testdata_path, 'test_project_wms_invalid_layers.qgs')),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetMap",
"BBOX": "613402.5658687877003,5809005.018114360981,619594.408781287726,5813869.006602735259",
"CRS": "EPSG:25832",
"WIDTH": "429",
"HEIGHT": "337",
"LAYERS": "areas and symbols,osm",
"STYLES": ",",
"FORMAT": "image/png",
"DPI": "200",
"MAP_RESOLUTION": "200",
"FORMAT_OPTIONS": "dpi:200"
}.items())])

r, h = self._result(self._execute_request(qs))

self.assertTrue('ServerException' in str(r))


if __name__ == '__main__':
unittest.main()

0 comments on commit 80e7534

Please sign in to comment.