Skip to content

Commit 2075141

Browse files
committed
[Server] Fixing tests
1 parent 7633d2a commit 2075141

File tree

6 files changed

+2563
-851
lines changed

6 files changed

+2563
-851
lines changed

tests/src/python/test_qgsserver_wms.py

+2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ def wms_request_compare_project(self, request, extra=None, reference_file=None):
123123
self.assertXMLEqual(response, expected, msg="request %s failed.\nQuery: %s\nExpected file: %s\nResponse:\n%s" % (query_string, request, reference_path, response.decode('utf-8')))
124124

125125
def test_wms_getcapabilities_project(self):
126+
"""WMS GetCapabilities without map parameter"""
126127
self.wms_request_compare_project('GetCapabilities')
128+
# reference_file='getcapabilities_without_map_param' could be the right response
127129

128130
def wms_inspire_request_compare(self, request):
129131
"""WMS INSPIRE tests"""
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
Content-Length: 6575
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<?xml version="1.0" encoding="utf-8"?>
5+
<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/?SERVICE=WMS&amp;REQUEST=GetSchemaExtension" version="1.3.0" xmlns:sld="http://www.opengis.net/sld">
6+
<Service>
7+
<Name>WMS</Name>
8+
<Title>QGIS TestProject</Title>
9+
<Abstract><![CDATA[Some UTF8 text èòù]]></Abstract>
10+
<KeywordList>
11+
<Keyword vocabulary="ISO">infoMapAccessService</Keyword>
12+
</KeywordList>
13+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/" xmlns:xlink="http://www.w3.org/1999/xlink"/>
14+
<ContactInformation>
15+
<ContactPersonPrimary>
16+
<ContactPerson>Alessandro Pasotti</ContactPerson>
17+
<ContactOrganization>QGIS dev team</ContactOrganization>
18+
</ContactPersonPrimary>
19+
<ContactElectronicMailAddress>elpaso@itopen.it</ContactElectronicMailAddress>
20+
</ContactInformation>
21+
<Fees>conditions unknown</Fees>
22+
<AccessConstraints>None</AccessConstraints>
23+
</Service>
24+
<Capability>
25+
<Request>
26+
<GetCapabilities>
27+
<Format>text/xml</Format>
28+
<DCPType>
29+
<HTTP>
30+
<Get>
31+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
32+
</Get>
33+
</HTTP>
34+
</DCPType>
35+
</GetCapabilities>
36+
<GetMap>
37+
<Format>image/jpeg</Format>
38+
<Format>image/png</Format>
39+
<Format>image/png; mode=16bit</Format>
40+
<Format>image/png; mode=8bit</Format>
41+
<Format>image/png; mode=1bit</Format>
42+
<Format>application/dxf</Format>
43+
<DCPType>
44+
<HTTP>
45+
<Get>
46+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
47+
</Get>
48+
</HTTP>
49+
</DCPType>
50+
</GetMap>
51+
<GetFeatureInfo>
52+
<Format>text/plain</Format>
53+
<Format>text/html</Format>
54+
<Format>text/xml</Format>
55+
<Format>application/vnd.ogc.gml</Format>
56+
<Format>application/vnd.ogc.gml/3.1.1</Format>
57+
<DCPType>
58+
<HTTP>
59+
<Get>
60+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
61+
</Get>
62+
</HTTP>
63+
</DCPType>
64+
</GetFeatureInfo>
65+
<sld:GetLegendGraphic>
66+
<Format>image/jpeg</Format>
67+
<Format>image/png</Format>
68+
<DCPType>
69+
<HTTP>
70+
<Get>
71+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
72+
</Get>
73+
</HTTP>
74+
</DCPType>
75+
</sld:GetLegendGraphic>
76+
<sld:DescribeLayer>
77+
<Format>text/xml</Format>
78+
<DCPType>
79+
<HTTP>
80+
<Get>
81+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
82+
</Get>
83+
</HTTP>
84+
</DCPType>
85+
</sld:DescribeLayer>
86+
<qgs:GetStyles>
87+
<Format>text/xml</Format>
88+
<DCPType>
89+
<HTTP>
90+
<Get>
91+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
92+
</Get>
93+
</HTTP>
94+
</DCPType>
95+
</qgs:GetStyles>
96+
</Request>
97+
<Exception>
98+
<Format>XML</Format>
99+
</Exception>
100+
<sld:UserDefinedSymbolization SupportSLD="1" RemoteWCS="0" UserLayer="0" InlineFeature="0" RemoteWFS="0" UserStyle="1"/>
101+
<Layer>
102+
<Title>QGIS Test Project</Title>
103+
<Abstract>QGIS Test Project</Abstract>
104+
<CRS>CRS:84</CRS>
105+
<CRS>EPSG:4326</CRS>
106+
<CRS>EPSG:3857</CRS>
107+
<EX_GeographicBoundingBox>
108+
<westBoundLongitude>8.20315</westBoundLongitude>
109+
<eastBoundLongitude>8.20416</eastBoundLongitude>
110+
<southBoundLatitude>44.9012</southBoundLatitude>
111+
<northBoundLatitude>44.9016</northBoundLatitude>
112+
</EX_GeographicBoundingBox>
113+
<BoundingBox maxy="5.60604e+06" maxx="913283" miny="5.60599e+06" CRS="EPSG:3857" minx="913171"/>
114+
<BoundingBox maxy="8.20416" maxx="44.9016" miny="8.20315" CRS="EPSG:4326" minx="44.9012"/>
115+
<Name>QGIS Test Project</Name>
116+
<KeywordList>
117+
<Keyword vocabulary="ISO">infoMapAccessService</Keyword>
118+
</KeywordList>
119+
<Layer queryable="1">
120+
<Name>layer_with_short_name</Name>
121+
<Title>A Layer with a short name</Title>
122+
<Abstract>A Layer with an abstract</Abstract>
123+
<CRS>CRS:84</CRS>
124+
<CRS>EPSG:4326</CRS>
125+
<CRS>EPSG:3857</CRS>
126+
<EX_GeographicBoundingBox>
127+
<westBoundLongitude>8.20346</westBoundLongitude>
128+
<eastBoundLongitude>8.20355</eastBoundLongitude>
129+
<southBoundLatitude>44.9014</southBoundLatitude>
130+
<northBoundLatitude>44.9015</northBoundLatitude>
131+
</EX_GeographicBoundingBox>
132+
<BoundingBox maxy="5.60603e+06" maxx="913215" miny="5.60601e+06" CRS="EPSG:3857" minx="913205"/>
133+
<BoundingBox maxy="8.20355" maxx="44.9015" miny="8.20346" CRS="EPSG:4326" minx="44.9014"/>
134+
<Style>
135+
<Name>default</Name>
136+
<Title>default</Title>
137+
<LegendURL>
138+
<Format>image/png</Format>
139+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?&amp;SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetLegendGraphic&amp;LAYER=layer_with_short_name&amp;FORMAT=image/png&amp;STYLE=default&amp;SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/>
140+
</LegendURL>
141+
</Style>
142+
</Layer>
143+
<Layer queryable="1">
144+
<Name>testlayer èé</Name>
145+
<Title>A test vector layer</Title>
146+
<Abstract>A test vector layer with unicode òà</Abstract>
147+
<CRS>CRS:84</CRS>
148+
<CRS>EPSG:4326</CRS>
149+
<CRS>EPSG:3857</CRS>
150+
<EX_GeographicBoundingBox>
151+
<westBoundLongitude>8.20346</westBoundLongitude>
152+
<eastBoundLongitude>8.20355</eastBoundLongitude>
153+
<southBoundLatitude>44.9014</southBoundLatitude>
154+
<northBoundLatitude>44.9015</northBoundLatitude>
155+
</EX_GeographicBoundingBox>
156+
<BoundingBox maxy="5.60603e+06" maxx="913215" miny="5.60601e+06" CRS="EPSG:3857" minx="913205"/>
157+
<BoundingBox maxy="8.20355" maxx="44.9015" miny="8.20346" CRS="EPSG:4326" minx="44.9014"/>
158+
<Style>
159+
<Name>default</Name>
160+
<Title>default</Title>
161+
<LegendURL>
162+
<Format>image/png</Format>
163+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?&amp;SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetLegendGraphic&amp;LAYER=testlayer èé&amp;FORMAT=image/png&amp;STYLE=default&amp;SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/>
164+
</LegendURL>
165+
</Style>
166+
</Layer>
167+
<Layer>
168+
<Name>group_name</Name>
169+
<Title>Group title</Title>
170+
<Abstract>Group abstract</Abstract>
171+
<CRS>CRS:84</CRS>
172+
<CRS>EPSG:4326</CRS>
173+
<CRS>EPSG:3857</CRS>
174+
<EX_GeographicBoundingBox>
175+
<westBoundLongitude>8.20346</westBoundLongitude>
176+
<eastBoundLongitude>8.20355</eastBoundLongitude>
177+
<southBoundLatitude>44.9014</southBoundLatitude>
178+
<northBoundLatitude>44.9015</northBoundLatitude>
179+
</EX_GeographicBoundingBox>
180+
<BoundingBox maxy="5.60603e+06" maxx="913215" miny="5.60601e+06" CRS="EPSG:3857" minx="913205"/>
181+
<BoundingBox maxy="8.20355" maxx="44.9015" miny="8.20346" CRS="EPSG:4326" minx="44.9014"/>
182+
<Layer queryable="1">
183+
<Name>testlayer2</Name>
184+
<Title>testlayer2</Title>
185+
<CRS>CRS:84</CRS>
186+
<CRS>EPSG:4326</CRS>
187+
<CRS>EPSG:3857</CRS>
188+
<EX_GeographicBoundingBox>
189+
<westBoundLongitude>8.20346</westBoundLongitude>
190+
<eastBoundLongitude>8.20355</eastBoundLongitude>
191+
<southBoundLatitude>44.9014</southBoundLatitude>
192+
<northBoundLatitude>44.9015</northBoundLatitude>
193+
</EX_GeographicBoundingBox>
194+
<BoundingBox maxy="5.60603e+06" maxx="913215" miny="5.60601e+06" CRS="EPSG:3857" minx="913205"/>
195+
<BoundingBox maxy="8.20355" maxx="44.9015" miny="8.20346" CRS="EPSG:4326" minx="44.9014"/>
196+
<Style>
197+
<Name>default</Name>
198+
<Title>default</Title>
199+
<LegendURL>
200+
<Format>image/png</Format>
201+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?&amp;SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetLegendGraphic&amp;LAYER=testlayer2&amp;FORMAT=image/png&amp;STYLE=default&amp;SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/>
202+
</LegendURL>
203+
</Style>
204+
</Layer>
205+
</Layer>
206+
<Layer>
207+
<Name>groupwithoutshortname</Name>
208+
<Title>groupwithoutshortname</Title>
209+
<CRS>CRS:84</CRS>
210+
<CRS>EPSG:4326</CRS>
211+
<CRS>EPSG:3857</CRS>
212+
<EX_GeographicBoundingBox>
213+
<westBoundLongitude>8.20346</westBoundLongitude>
214+
<eastBoundLongitude>8.20355</eastBoundLongitude>
215+
<southBoundLatitude>44.9014</southBoundLatitude>
216+
<northBoundLatitude>44.9015</northBoundLatitude>
217+
</EX_GeographicBoundingBox>
218+
<BoundingBox maxy="5.60603e+06" maxx="913215" miny="5.60601e+06" CRS="EPSG:3857" minx="913205"/>
219+
<BoundingBox maxy="8.20355" maxx="44.9015" miny="8.20346" CRS="EPSG:4326" minx="44.9014"/>
220+
<Layer queryable="0">
221+
<Name>testlayer3</Name>
222+
<Title>testlayer3</Title>
223+
<CRS>CRS:84</CRS>
224+
<CRS>EPSG:4326</CRS>
225+
<CRS>EPSG:3857</CRS>
226+
<EX_GeographicBoundingBox>
227+
<westBoundLongitude>8.20346</westBoundLongitude>
228+
<eastBoundLongitude>8.20355</eastBoundLongitude>
229+
<southBoundLatitude>44.9014</southBoundLatitude>
230+
<northBoundLatitude>44.9015</northBoundLatitude>
231+
</EX_GeographicBoundingBox>
232+
<BoundingBox maxy="5.60603e+06" maxx="913215" miny="5.60601e+06" CRS="EPSG:3857" minx="913205"/>
233+
<BoundingBox maxy="8.20355" maxx="44.9015" miny="8.20346" CRS="EPSG:4326" minx="44.9014"/>
234+
<Style>
235+
<Name>default</Name>
236+
<Title>default</Title>
237+
<LegendURL>
238+
<Format>image/png</Format>
239+
<OnlineResource xlink:type="simple" xlink:href="https://www.qgis.org/?&amp;SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetLegendGraphic&amp;LAYER=testlayer3&amp;FORMAT=image/png&amp;STYLE=default&amp;SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/>
240+
</LegendURL>
241+
</Style>
242+
</Layer>
243+
</Layer>
244+
</Layer>
245+
</Capability>
246+
</WMS_Capabilities>

0 commit comments

Comments
 (0)