Skip to content

Commit

Permalink
Merge pull request #44361 from qgis/backport-44111-to-release-3_16
Browse files Browse the repository at this point in the history
[Backport release-3_16] [Server][Tests] Extend WMS dimension tests
  • Loading branch information
rldhont committed Aug 18, 2021
2 parents ce9eef8 + 5e06460 commit c6cdb2e
Show file tree
Hide file tree
Showing 11 changed files with 874 additions and 359 deletions.
110 changes: 109 additions & 1 deletion tests/src/python/test_qgsserver_wms_dimension.py
Expand Up @@ -66,7 +66,7 @@ def test_wms_getmap_default(self):
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetMap",
"LAYERS": "dem,Slopes,Contours",
"LAYERS": "dem,Slopes,Contours,Datetime_dim",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-1219081,4281848,172260,5673189",
Expand Down Expand Up @@ -116,6 +116,42 @@ def test_wms_getmap_simple_value(self):
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Dimension_RangeElevation_Value")

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetMap",
"LAYERS": "dem,Datetime_dim",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-1219081,4281848,172260,5673189",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"TIME": "2021-05-31T17:00:00"
}.items())])

r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Dimension_Time_Value")

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetMap",
"LAYERS": "dem,Datetime_dim",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-1219081,4281848,172260,5673189",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"DIM_DATE": "2021-05-31"
}.items())])

r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Dimension_Date_Value")

# multi dimension with value
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
Expand Down Expand Up @@ -174,6 +210,42 @@ def test_wms_getmap_range_value(self):
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Dimension_RangeElevation_RangeValue")

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetMap",
"LAYERS": "dem,Datetime_dim",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-1219081,4281848,172260,5673189",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"TIME": "2021-05-31T09:00:00/2021-06-30T09:00:00"
}.items())])

r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Dimension_Time_RangeValue")

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetMap",
"LAYERS": "dem,Datetime_dim",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-1219081,4281848,172260,5673189",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"DIM_DATE": "2021-05-31/2021-06-30"
}.items())])

r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Dimension_Date_RangeValue")

def test_wms_getmap_multi_values(self):
# dimension with multi values
qs = "?" + "&".join(["%s=%s" % i for i in list({
Expand Down Expand Up @@ -212,6 +284,42 @@ def test_wms_getmap_multi_values(self):
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Dimension_RangeElevation_MultiValues")

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetMap",
"LAYERS": "dem,Datetime_dim",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-1219081,4281848,172260,5673189",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"TIME": "2021-05-31T10:00:00,2021-05-31T17:00:00"
}.items())])

r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Dimension_Time_MultiValues")

qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetMap",
"LAYERS": "dem,Datetime_dim",
"STYLES": "",
"FORMAT": "image/png",
"BBOX": "-1219081,4281848,172260,5673189",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"DIM_DATE": "2021-05-31,2021-06-30"
}.items())])

r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetMap_Dimension_Date_MultiValues")

def test_wms_getmap_mix_values(self):
# dimension with mix values
qs = "?" + "&".join(["%s=%s" % i for i in list({
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/testdata/qgis_server_accesscontrol/dimensions.gpkg
Binary file not shown.

0 comments on commit c6cdb2e

Please sign in to comment.