Skip to content

Commit bc6ea8c

Browse files
authored
Merge pull request #7669 from sbrunner/wfs-namespace
Add tests on WFS GetFeature with right namespace
2 parents c0032f1 + eab6440 commit bc6ea8c

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

tests/src/python/test_qgsserver_wfs.py

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ def wfs_getfeature_post_compare(self, requestid, request):
190190
)
191191

192192
def test_getfeature_post(self):
193+
tests = []
194+
193195
template = """<?xml version="1.0" encoding="UTF-8"?>
194196
<wfs:GetFeature service="WFS" version="1.0.0" {} xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
195197
<wfs:Query typeName="testlayer" xmlns:feature="http://www.qgis.org/gml">
@@ -205,8 +207,6 @@ def test_getfeature_post(self):
205207
</wfs:Query>
206208
</wfs:GetFeature>
207209
"""
208-
209-
tests = []
210210
tests.append(('nobbox_post', template.format("")))
211211
tests.append(('startindex2_post', template.format('startIndex="2"')))
212212
tests.append(('limit2_post', template.format('maxFeatures="2"')))
@@ -307,6 +307,41 @@ def test_getfeature_post(self):
307307
"""
308308
tests.append(('bbox_inside_and_post', andBboxTemplate.format("")))
309309

310+
# With namespace
311+
template = """<?xml version="1.0" encoding="UTF-8"?>
312+
<wfs:GetFeature service="WFS" version="1.0.0" {} xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
313+
<wfs:Query typeName="feature:testlayer" xmlns:feature="http://www.qgis.org/gml">
314+
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
315+
<ogc:BBOX>
316+
<ogc:PropertyName>geometry</ogc:PropertyName>
317+
<gml:Envelope xmlns:gml="http://www.opengis.net/gml">
318+
<gml:lowerCorner>8 44</gml:lowerCorner>
319+
<gml:upperCorner>9 45</gml:upperCorner>
320+
</gml:Envelope>
321+
</ogc:BBOX>
322+
</ogc:Filter>
323+
</wfs:Query>
324+
</wfs:GetFeature>
325+
"""
326+
tests.append(('nobbox_post', template.format("")))
327+
328+
template = """<?xml version="1.0" encoding="UTF-8"?>
329+
<wfs:GetFeature service="WFS" version="1.0.0" {} xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
330+
<wfs:Query typeName="testlayer" xmlns="http://www.qgis.org/gml">
331+
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
332+
<ogc:BBOX>
333+
<ogc:PropertyName>geometry</ogc:PropertyName>
334+
<gml:Envelope xmlns:gml="http://www.opengis.net/gml">
335+
<gml:lowerCorner>8 44</gml:lowerCorner>
336+
<gml:upperCorner>9 45</gml:upperCorner>
337+
</gml:Envelope>
338+
</ogc:BBOX>
339+
</ogc:Filter>
340+
</wfs:Query>
341+
</wfs:GetFeature>
342+
"""
343+
tests.append(('nobbox_post', template.format("")))
344+
310345
for id, req in tests:
311346
self.wfs_getfeature_post_compare(id, req)
312347

0 commit comments

Comments
 (0)