Skip to content

Commit 6447bee

Browse files
committed
Add some tests
1 parent e67a191 commit 6447bee

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/src/python/test_qgsserver_wms.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,44 @@ def test_wms_getmap_invalid_parameters(self):
428428
err = b"BBOX (\'-16817707,-4710778,5696513,FOO\') cannot be converted into a rectangle" in r
429429
self.assertTrue(err)
430430

431+
# test invalid bbox : xmin > xmax
432+
qs = "?" + "&".join(["%s=%s" % i for i in list({
433+
"MAP": urllib.parse.quote(self.projectPath),
434+
"SERVICE": "WMS",
435+
"VERSION": "1.1.1",
436+
"REQUEST": "GetMap",
437+
"LAYERS": "Country",
438+
"STYLES": "",
439+
"FORMAT": "image/png",
440+
"BBOX": "1,0,0,1",
441+
"HEIGHT": "500",
442+
"WIDTH": "500",
443+
"CRS": "EPSG:3857"
444+
}.items())])
445+
446+
r, h = self._result(self._execute_request(qs))
447+
err = b"cannot be converted into a rectangle" in r
448+
self.assertTrue(err)
449+
450+
# test invalid bbox : ymin > ymax
451+
qs = "?" + "&".join(["%s=%s" % i for i in list({
452+
"MAP": urllib.parse.quote(self.projectPath),
453+
"SERVICE": "WMS",
454+
"VERSION": "1.1.1",
455+
"REQUEST": "GetMap",
456+
"LAYERS": "Country",
457+
"STYLES": "",
458+
"FORMAT": "image/png",
459+
"BBOX": "0,1,0,0",
460+
"HEIGHT": "500",
461+
"WIDTH": "500",
462+
"CRS": "EPSG:3857"
463+
}.items())])
464+
465+
r, h = self._result(self._execute_request(qs))
466+
err = b"cannot be converted into a rectangle" in r
467+
self.assertTrue(err)
468+
431469
# opacities should be a list of int
432470
qs = "?" + "&".join(["%s=%s" % i for i in list({
433471
"MAP": urllib.parse.quote(self.projectPath),

0 commit comments

Comments
 (0)