From 9fca4982d3acdd4df1d5a080117479e1f58f6e9e Mon Sep 17 00:00:00 2001 From: Marco Hugentobler Date: Tue, 21 Jan 2020 09:07:59 +0100 Subject: [PATCH] Add unit test for opacity in GetProjectSettings --- tests/src/python/test_qgsserver_wms.py | 3 + .../getprojectsettings_opacity.txt | 381 +++ .../qgis_server/test_opacity_project.qgs | 2102 +++++++++++++++++ 3 files changed, 2486 insertions(+) create mode 100644 tests/testdata/qgis_server/getprojectsettings_opacity.txt create mode 100644 tests/testdata/qgis_server/test_opacity_project.qgs diff --git a/tests/src/python/test_qgsserver_wms.py b/tests/src/python/test_qgsserver_wms.py index edc37ce78c4..fb8867c2be3 100644 --- a/tests/src/python/test_qgsserver_wms.py +++ b/tests/src/python/test_qgsserver_wms.py @@ -102,6 +102,9 @@ class TestQgsServerWMS(TestQgsServerWMSTestBase): def test_getprojectsettings(self): self.wms_request_compare('GetProjectSettings') + def test_getprojectsettings_opacity(self): + self.wms_request_compare('GetProjectSettings', None, 'getprojectsettings_opacity', 'test_opacity_project.qgs') + def test_getcontext(self): self.wms_request_compare('GetContext') diff --git a/tests/testdata/qgis_server/getprojectsettings_opacity.txt b/tests/testdata/qgis_server/getprojectsettings_opacity.txt new file mode 100644 index 00000000000..1d3bfa6b2a9 --- /dev/null +++ b/tests/testdata/qgis_server/getprojectsettings_opacity.txt @@ -0,0 +1,381 @@ +***** +Content-Type: text/xml; charset=utf-8 + + + + + WMS + QGIS TestProject + + + infoMapAccessService + + + + + Alessandro Pasotti + QGIS dev team + + elpaso@itopen.it + + conditions unknown + None + + + + + text/xml + + + + + + + + + + image/jpeg + image/png + image/png; mode=16bit + image/png; mode=8bit + image/png; mode=1bit + application/dxf + + + + + + + + + + text/plain + text/html + text/xml + application/vnd.ogc.gml + application/vnd.ogc.gml/3.1.1 + application/json + application/geo+json + + + + + + + + + + image/jpeg + image/png + application/json + + + + + + + + + + text/xml + + + + + + + + + + text/xml + + + + + + + + + + svg + png + pdf + + + + + + + + + + + XML + + + + + + + + + + + + + QGIS Test Project + QGIS Test Project + CRS:84 + EPSG:4326 + EPSG:3857 + + 8.203154 + 8.204165 + 44.901236 + 44.901599 + + + + QGIS Test Project + + infoMapAccessService + + QGIS Test Project + + layer_with_short_name + A Layer with a short name + A Layer with an abstract + CRS:84 + EPSG:4326 + EPSG:3857 + + 8.203459 + 8.203547 + 44.901394 + 44.901483 + + + + + testlayer + + + + + + + + landsat + landsat + CRS:84 + EPSG:4326 + EPSG:3857 + + 17.924273 + 18.045658 + 30.151856 + 30.257289 + + + + + landsat + + + testlayer èé + A test vector layer + A test vector layer with unicode òà + CRS:84 + EPSG:4326 + EPSG:3857 + + 8.203459 + 8.203547 + 44.901394 + 44.901483 + + + + + testlayer èé + + + + + + + + fields_alias + A test vector layer + A test vector layer with unicode òà + CRS:84 + EPSG:4326 + EPSG:3857 + + 8.203459 + 8.203547 + 44.901394 + 44.901483 + + + + + fields_alias + + + + + + + + exclude_attribute + A test vector layer + A test vector layer with unicode òà + CRS:84 + EPSG:4326 + EPSG:3857 + + 8.203459 + 8.203547 + 44.901394 + 44.901483 + + + + + exclude_attribute + + + + + + + group_name + Group title + Group abstract + CRS:84 + EPSG:4326 + EPSG:3857 + + 8.203459 + 8.203548 + 44.901394 + 44.901483 + + + + groupwithshortname + + testlayer2 + testlayer2 + CRS:84 + EPSG:4326 + EPSG:3857 + + 8.203459 + 8.203547 + 44.901394 + 44.901483 + + + + + testlayer2 + + + + + + + + + groupwithoutshortname + groupwithoutshortname + CRS:84 + EPSG:4326 + EPSG:3857 + + 8.203459 + 8.203548 + 44.901394 + 44.901483 + + + + groupwithoutshortname + + testlayer3 + testlayer3 + CRS:84 + EPSG:4326 + EPSG:3857 + + 8.203459 + 8.203547 + 44.901394 + 44.901483 + + + + + testlayer3 + + + + + + + + + testlayer3,testlayer2,exclude_attribute,fields_alias,testlayer èé,landsat,layer_with_short_name + + diff --git a/tests/testdata/qgis_server/test_opacity_project.qgs b/tests/testdata/qgis_server/test_opacity_project.qgs new file mode 100644 index 00000000000..b9c840a32ac --- /dev/null +++ b/tests/testdata/qgis_server/test_opacity_project.qgs @@ -0,0 +1,2102 @@ + + + + QGIS Test Project + + + + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + testlayer20150528120452665 + testlayer_c0988fd7_97ca_451d_adbc_37ad6d10583a + testlayer_0b835118_a5d5_4255_b5dd_f42253c0a4a0 + testlayer_2b89ed65_ef2f_4897_af15_9b32d4c4e040 + testlayer_èé_cf86cf11_222f_4b62_929c_12cfc82b9774 + testlayer_èé_2_a5f61891_b949_43e3_ad30_84013fc922de + landsat_a7d15b35_ca83_4b23_a9fb_af3fbdd60d15 + + + + + + + + + + + + + + + degrees + + 17.92123882869385909 + 30.1492204088525888 + 18.0486921925404431 + 30.25992437587047235 + + 0 + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + degrees + + 0 + 0 + 0 + 0 + + 0 + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + 0 + + + degrees + + 0 + 0 + 0 + 0 + + 0 + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + 0 + + + degrees + + 0 + 0 + 0 + 0 + + 0 + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + 0 + + + + + 781662.375 + 3339523.125 + 793062.375 + 3350923.125 + + landsat_a7d15b35_ca83_4b23_a9fb_af3fbdd60d15 + ../landsat.tif + + + + landsat + + + +proj=utm +zone=33 +datum=WGS84 +units=m +no_defs + 3117 + 32633 + EPSG:32633 + WGS 84 / UTM zone 33N + utm + WGS84 + false + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + + + + + + + gdal + + + + + + + + + + + + + + + + 1 + 1 + 1 + + + + + + + + + + + + MinMax + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + 122 + 130 + StretchToMinimumMaximum + + + + + + + 0 + + + + 8.20345930703634352 + 44.90139483904469131 + 8.20354699399348775 + 44.90148252600183554 + + testlayer20150528120452665 + ./testlayer.shp + A test vector layer + A test vector layer with unicode òà + + + + testlayer èé + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + + + + + + + + + + + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + + + ogr + + + + + + + + + + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 0.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + 0 + . + + 0 + generatedlayout + + + + "name" + [% 'Name: ' || "name" %] + + + + 8.20345930703634352 + 44.90139483904469131 + 8.20354699399348775 + 44.90148252600183554 + + testlayer_0b835118_a5d5_4255_b5dd_f42253c0a4a0 + ./testlayer.shp + + + + testlayer3 + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + ogr + + + + + + + + + + + 0 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 0.8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + 0 + + + 0 + generatedlayout + + + + + + + + + 8.20345930703634352 + 44.90139483904469131 + 8.20354699399348775 + 44.90148252600183554 + + testlayer_2b89ed65_ef2f_4897_af15_9b32d4c4e040 + ./testlayer.shp + + + + testlayer2 + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + + + + + + + ogr + + + + + + + + + + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + id + + + + + 8.20345930703634352 + 44.90139483904469131 + 8.20354699399348775 + 44.90148252600183554 + + testlayer_c0988fd7_97ca_451d_adbc_37ad6d10583a + ./testlayer.shp + layer_with_short_name + A Layer with a short name + A Layer with an abstract + + + + testlayer + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + + + + + + + ogr + + + + + + + + + + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + id + + + + + 8.20345930703634352 + 44.90139483904469131 + 8.20354699399348775 + 44.90148252600183554 + + testlayer_èé_2_a5f61891_b949_43e3_ad30_84013fc922de + ./testlayer.shp + A test vector layer + A test vector layer with unicode òà + + + + exclude_attribute + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + + + + + + + ogr + + + + + + + + + + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + 0 + . + + 0 + generatedlayout + + + + + + + + + + + + name + [% 'Name: ' || "name" %] + + + + 8.20345930703634352 + 44.90139483904469131 + 8.20354699399348775 + 44.90148252600183554 + + testlayer_èé_cf86cf11_222f_4b62_929c_12cfc82b9774 + ./testlayer.shp + A test vector layer + A test vector layer with unicode òà + + + + fields_alias + + + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + WGS84 + true + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + + + + + + + ogr + + + + + + + + + + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + 0 + . + + 0 + generatedlayout + + + + + + + + + + + + name + [% 'Name: ' || "name" %] + + + + + + + + + + + + + None + + + WGS84 + + false + + + testlayer20150528120452665 + + + true + conditions unknown + + 3452 + +proj=longlat +datum=WGS84 +no_defs + 1 + EPSG:4326 + + + + + + + true + + + 1 + + 255 + + + + + + testlayer20150528120452665 + + + testlayer20150528120452665 + + + testlayer20150528120452665 + + + + false + + + 255 + 0 + 255 + 255 + 255 + 255 + 255 + + + false + + Some UTF8 text èòù + + 2 + + + + + + + 0 + off + current_layer + + + + + + 8.20315414376310059 + 44.901236559338642 + 8.204164917965862 + 44.90159838674664172 + + + 8 + + + 2 + D + true + + false + + m2 + meters + + + + 90 + QGIS dev team + QGIS TestProject + 4 + false + Alessandro Pasotti + + + + + + + + elpaso@itopen.it + + + testlayer_0b835118_a5d5_4255_b5dd_f42253c0a4a0 + + + + 0 + 0 + true + false + 16 + 30 + true + false + 50 + false + + + true + + + + + + + + + + QGIS Test Project + + + + + + + + + + + + + 2000-01-01T00:00:00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +