Skip to content
Permalink
Browse files

Add test to ensure server throws exception if layer is invalid

  • Loading branch information
mhugent committed Jan 22, 2019
1 parent ffae79b commit 80e75342a74b6ca9e2ba10263ad9fa8e10499ccf
@@ -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.
You can’t perform that action at this time.