Skip to content

Commit

Permalink
[Tests][Server] Add WMS GetPrint group
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Apr 22, 2020
1 parent 6ccb9c0 commit 13434dc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/src/python/test_qgsserver_wms_getprint.py
Expand Up @@ -355,6 +355,44 @@ def test_wms_getprint_style(self):
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetPrint_StyleCustom")

def test_wms_getprint_group(self):
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectGroupsPath),
"SERVICE": "WMS",
"VERSION": "1.1.1",
"REQUEST": "GetPrint",
"TEMPLATE": "layoutA4",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country_Diagrams,Country_Labels,Country",
"CRS": "EPSG:3857"
}.items())])

r_individual, _ = self._result(self._execute_request(qs))

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectGroupsPath),
"SERVICE": "WMS",
"VERSION": "1.1.1",
"REQUEST": "GetPrint",
"TEMPLATE": "layoutA4",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "CountryGroup",
"CRS": "EPSG:3857"
}.items())])

r_group, _ = self._result(self._execute_request(qs))

""" Debug check:
f = open('grouped.png', 'wb+')
f.write(r_group)
f.close()
f = open('individual.png', 'wb+')
f.write(r_individual)
f.close()
#"""

self.assertEqual(r_individual, r_group, 'Individual layers query and group layers query results should be identical')

def test_wms_getprint_legend(self):
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 13434dc

Please sign in to comment.