Skip to content

Commit cbc4270

Browse files
committed
Add unit test for getprint and external layers
1 parent 216826b commit cbc4270

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/src/python/test_qgsserver_wms_getprint.py

+24
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,30 @@ def test_wms_getprint_atlas_getProjectSettings(self):
437437
self.assertTrue('atlasEnabled="1"' in str(r))
438438
self.assertTrue('<PrimaryKeyAttribute>' in str(r))
439439

440+
@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true', 'Can\'t rely on external resources for continuous integration')
441+
def test_wms_getprint_external(self):
442+
qs = "?" + "&".join(["%s=%s" % i for i in list({
443+
"MAP": urllib.parse.quote(self.projectPath),
444+
"SERVICE": "WMS",
445+
"VERSION": "1.1.1",
446+
"REQUEST": "GetPrint",
447+
"TEMPLATE": "layoutA4",
448+
"map0:EXTENT": "-90,-180,90,180",
449+
"map0:LAYERS": "EXTERNAL_WMS:landsat",
450+
"landsat:layers": "GEBCO_LATEST",
451+
"landsat:dpiMode": "7",
452+
"landsat:url": "https://www.gebco.net/data_and_products/gebco_web_services/web_map_service/mapserv",
453+
"landsat:crs": "EPSG:4326",
454+
"landsat:styles": "default",
455+
"landsat:format": "image/jpeg",
456+
"landsat:bbox": "-90,-180,90,180",
457+
"landsat:version": "1.3.0",
458+
"CRS": "EPSG:4326"
459+
}.items())])
460+
461+
r, h = self._result(self._execute_request(qs))
462+
self._img_diff_error(r, h, "WMS_GetPrint_External")
463+
440464

441465
if __name__ == '__main__':
442466
unittest.main()
Loading

0 commit comments

Comments
 (0)