Add unit test for opacity in GetProjectSettings

This commit is contained in:
Marco Hugentobler 2020-01-21 09:07:59 +01:00
parent ae204986ef
commit 9fca4982d3
3 changed files with 2486 additions and 0 deletions

View File

@ -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')

View File

@ -0,0 +1,381 @@
*****
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="utf-8"?>
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qgs="http://www.qgis.org/wms" xmlns="http://www.opengis.net/wms" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://www.qgis.org/wms https://www.qgis.org/?*****" version="1.3.0" xmlns:sld="http://www.opengis.net/sld">
<Service>
<Name>WMS</Name>
<Title>QGIS TestProject</Title>
<Abstract><![CDATA[Some UTF8 text èòù]]></Abstract>
<KeywordList>
<Keyword vocabulary="ISO">infoMapAccessService</Keyword>
</KeywordList>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<ContactInformation>
<ContactPersonPrimary>
<ContactPerson>Alessandro Pasotti</ContactPerson>
<ContactOrganization>QGIS dev team</ContactOrganization>
</ContactPersonPrimary>
<ContactElectronicMailAddress>elpaso@itopen.it</ContactElectronicMailAddress>
</ContactInformation>
<Fees>conditions unknown</Fees>
<AccessConstraints>None</AccessConstraints>
</Service>
<Capability>
<Request>
<GetCapabilities>
<Format>text/xml</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</Get>
</HTTP>
</DCPType>
</GetCapabilities>
<GetMap>
<Format>image/jpeg</Format>
<Format>image/png</Format>
<Format>image/png; mode=16bit</Format>
<Format>image/png; mode=8bit</Format>
<Format>image/png; mode=1bit</Format>
<Format>application/dxf</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</Get>
</HTTP>
</DCPType>
</GetMap>
<GetFeatureInfo>
<Format>text/plain</Format>
<Format>text/html</Format>
<Format>text/xml</Format>
<Format>application/vnd.ogc.gml</Format>
<Format>application/vnd.ogc.gml/3.1.1</Format>
<Format>application/json</Format>
<Format>application/geo+json</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</Get>
</HTTP>
</DCPType>
</GetFeatureInfo>
<sld:GetLegendGraphic>
<Format>image/jpeg</Format>
<Format>image/png</Format>
<Format>application/json</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</Get>
</HTTP>
</DCPType>
</sld:GetLegendGraphic>
<sld:DescribeLayer>
<Format>text/xml</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</Get>
</HTTP>
</DCPType>
</sld:DescribeLayer>
<qgs:GetStyles>
<Format>text/xml</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</Get>
</HTTP>
</DCPType>
</qgs:GetStyles>
<GetPrint>
<Format>svg</Format>
<Format>png</Format>
<Format>pdf</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</Get>
</HTTP>
</DCPType>
</GetPrint>
</Request>
<Exception>
<Format>XML</Format>
</Exception>
<sld:UserDefinedSymbolization SupportSLD="1" RemoteWCS="0" UserLayer="0" InlineFeature="0" RemoteWFS="0" UserStyle="1"/>
<ComposerTemplates>
<ComposerTemplate height="210" width="297" name="mytemplate">
<ComposerMap height="26" width="61" name="map0"/>
<ComposerMap height="103" width="87" name="map1"/>
</ComposerTemplate>
</ComposerTemplates>
<WFSLayers>
<WFSLayer name="testlayer èé"/>
</WFSLayers>
<Layer>
<Title>QGIS Test Project</Title>
<Abstract>QGIS Test Project</Abstract>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>8.203154</westBoundLongitude>
<eastBoundLongitude>8.204165</eastBoundLongitude>
<southBoundLatitude>44.901236</southBoundLatitude>
<northBoundLatitude>44.901599</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="5606043.446" maxx="913283.462" miny="5605986.581" CRS="EPSG:3857" minx="913170.942"/>
<BoundingBox maxy="8.204165" maxx="44.901599" miny="8.203154" CRS="EPSG:4326" minx="44.901236"/>
<Name>QGIS Test Project</Name>
<KeywordList>
<Keyword vocabulary="ISO">infoMapAccessService</Keyword>
</KeywordList>
<TreeName>QGIS Test Project</TreeName>
<Layer geometryType="Point" queryable="1" displayField="id" visible="1" opacity="1">
<Name>layer_with_short_name</Name>
<Title>A Layer with a short name</Title>
<Abstract>A Layer with an abstract</Abstract>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>8.203459</westBoundLongitude>
<eastBoundLongitude>8.203547</eastBoundLongitude>
<southBoundLatitude>44.901394</southBoundLatitude>
<northBoundLatitude>44.901483</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/>
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/>
<Style>
<Name>default</Name>
<Title>default</Title>
<LegendURL>
<Format>image/png</Format>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</LegendURL>
</Style>
<TreeName>testlayer</TreeName>
<Attributes>
<Attribute precision="0" type="qlonglong" editType="TextEdit" typeName="Integer64" name="id" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="TextEdit" typeName="String" name="name" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="TextEdit" typeName="String" name="utf8nameè" comment="" length="13"/>
</Attributes>
</Layer>
<Layer queryable="1" visible="1" opacity="1">
<Name>landsat</Name>
<Title>landsat</Title>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>17.924273</westBoundLongitude>
<eastBoundLongitude>18.045658</eastBoundLongitude>
<southBoundLatitude>30.151856</southBoundLatitude>
<northBoundLatitude>30.257289</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="3536664.948" maxx="2008833.414" miny="3523084.517" CRS="EPSG:3857" minx="1995320.991"/>
<BoundingBox maxy="18.045658" maxx="30.257289" miny="17.924273" CRS="EPSG:4326" minx="30.151856"/>
<Style>
<Name>default</Name>
<Title>default</Title>
<LegendURL>
<Format>image/png</Format>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</LegendURL>
</Style>
<TreeName>landsat</TreeName>
</Layer>
<Layer geometryType="Point" queryable="1" displayField="name" visible="1" opacity="0.5">
<Name>testlayer èé</Name>
<Title>A test vector layer</Title>
<Abstract>A test vector layer with unicode òà</Abstract>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>8.203459</westBoundLongitude>
<eastBoundLongitude>8.203547</eastBoundLongitude>
<southBoundLatitude>44.901394</southBoundLatitude>
<northBoundLatitude>44.901483</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/>
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/>
<Style>
<Name>default</Name>
<Title>default</Title>
<LegendURL>
<Format>image/png</Format>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</LegendURL>
</Style>
<TreeName>testlayer èé</TreeName>
<Attributes>
<Attribute precision="0" type="qlonglong" editType="TextEdit" typeName="Integer64" name="id" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="TextEdit" typeName="String" name="name" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="TextEdit" typeName="String" name="utf8nameè" comment="" length="13"/>
</Attributes>
</Layer>
<Layer geometryType="Point" queryable="1" displayField="alias_name" visible="1" opacity="1">
<Name>fields_alias</Name>
<Title>A test vector layer</Title>
<Abstract>A test vector layer with unicode òà</Abstract>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>8.203459</westBoundLongitude>
<eastBoundLongitude>8.203547</eastBoundLongitude>
<southBoundLatitude>44.901394</southBoundLatitude>
<northBoundLatitude>44.901483</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/>
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/>
<Style>
<Name>default</Name>
<Title>default</Title>
<LegendURL>
<Format>image/png</Format>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</LegendURL>
</Style>
<TreeName>fields_alias</TreeName>
<Attributes>
<Attribute precision="0" type="qlonglong" editType="TextEdit" typeName="Integer64" alias="alias_id" name="id" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="TextEdit" typeName="String" alias="alias_name" name="name" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="TextEdit" typeName="String" name="utf8nameè" comment="" length="13"/>
</Attributes>
</Layer>
<Layer geometryType="Point" queryable="1" displayField="name" visible="1" opacity="1">
<Name>exclude_attribute</Name>
<Title>A test vector layer</Title>
<Abstract>A test vector layer with unicode òà</Abstract>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>8.203459</westBoundLongitude>
<eastBoundLongitude>8.203547</eastBoundLongitude>
<southBoundLatitude>44.901394</southBoundLatitude>
<northBoundLatitude>44.901483</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/>
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/>
<Style>
<Name>default</Name>
<Title>default</Title>
<LegendURL>
<Format>image/png</Format>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</LegendURL>
</Style>
<TreeName>exclude_attribute</TreeName>
<Attributes>
<Attribute precision="0" type="qlonglong" editType="TextEdit" typeName="Integer64" name="id" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="TextEdit" typeName="String" name="utf8nameè" comment="" length="13"/>
</Attributes>
</Layer>
<Layer mutuallyExclusive="0" visible="1" queryable="1">
<Name>group_name</Name>
<Title>Group title</Title>
<Abstract>Group abstract</Abstract>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>8.203459</westBoundLongitude>
<eastBoundLongitude>8.203548</eastBoundLongitude>
<southBoundLatitude>44.901394</southBoundLatitude>
<northBoundLatitude>44.901483</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="5606025.239" maxx="913214.676" miny="5606011.456" CRS="EPSG:3857" minx="913204.911"/>
<BoundingBox maxy="8.203548" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/>
<TreeName>groupwithshortname</TreeName>
<Layer geometryType="Point" queryable="1" displayField="id" visible="1" opacity="1">
<Name>testlayer2</Name>
<Title>testlayer2</Title>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>8.203459</westBoundLongitude>
<eastBoundLongitude>8.203547</eastBoundLongitude>
<southBoundLatitude>44.901394</southBoundLatitude>
<northBoundLatitude>44.901483</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/>
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/>
<Style>
<Name>default</Name>
<Title>default</Title>
<LegendURL>
<Format>image/png</Format>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</LegendURL>
</Style>
<TreeName>testlayer2</TreeName>
<Attributes>
<Attribute precision="0" type="qlonglong" editType="TextEdit" typeName="Integer64" name="id" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="TextEdit" typeName="String" name="name" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="TextEdit" typeName="String" name="utf8nameè" comment="" length="13"/>
</Attributes>
</Layer>
</Layer>
<Layer mutuallyExclusive="0" queryable="0" visible="1">
<Name>groupwithoutshortname</Name>
<Title>groupwithoutshortname</Title>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>8.203459</westBoundLongitude>
<eastBoundLongitude>8.203548</eastBoundLongitude>
<southBoundLatitude>44.901394</southBoundLatitude>
<northBoundLatitude>44.901483</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="5606025.239" maxx="913214.676" miny="5606011.456" CRS="EPSG:3857" minx="913204.911"/>
<BoundingBox maxy="8.203548" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/>
<TreeName>groupwithoutshortname</TreeName>
<Layer geometryType="Point" queryable="0" displayField="name" visible="1" opacity="0.8">
<Name>testlayer3</Name>
<Title>testlayer3</Title>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>8.203459</westBoundLongitude>
<eastBoundLongitude>8.203547</eastBoundLongitude>
<southBoundLatitude>44.901394</southBoundLatitude>
<northBoundLatitude>44.901483</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/>
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/>
<Style>
<Name>default</Name>
<Title>default</Title>
<LegendURL>
<Format>image/png</Format>
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?*****" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</LegendURL>
</Style>
<TreeName>testlayer3</TreeName>
<Attributes>
<Attribute precision="0" type="qlonglong" editType="" typeName="Integer64" name="id" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="" typeName="String" name="name" comment="" length="10"/>
<Attribute precision="0" type="QString" editType="" typeName="String" name="utf8nameè" comment="" length="13"/>
</Attributes>
</Layer>
</Layer>
</Layer>
<LayerDrawingOrder>testlayer3,testlayer2,exclude_attribute,fields_alias,testlayer èé,landsat,layer_with_short_name</LayerDrawingOrder>
</Capability>
</WMS_Capabilities>

File diff suppressed because it is too large Load Diff