Skip to content
Permalink
Browse files
[Server][Tests] Extend WMS dimension tests
Add tests on TIME dimension and a date dimension based on a date field.
  • Loading branch information
rldhont authored and nyalldawson committed Aug 17, 2021
1 parent ce9eef8 commit 5e06460241b6fc0d4817c3ac4b14ad1290c89137
@@ -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",
@@ -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),
@@ -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({
@@ -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({
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 5e06460

Please sign in to comment.