Skip to content

Commit 3acabad

Browse files
committed
fix PyQgsServer test in nightlies
1 parent 789da22 commit 3acabad

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

tests/src/python/test_qgsserver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os
1616
import re
1717
import unittest
18+
import urllib
1819
from qgis.server import QgsServer
1920
from qgis.core import QgsMessageLog
2021
from utilities import unitTestDataPath
@@ -102,10 +103,10 @@ def responseComplete(self):
102103

103104
## WMS tests
104105
def wms_request_compare(self, request):
105-
project = self.testdata_path + "testproject.qgs"
106+
project = self.testdata_path + "test+project.qgs"
106107
assert os.path.exists(project), "Project file not found: " + project
107108

108-
query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (project, request)
109+
query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (urllib.quote(project), request)
109110
response = str(self.server.handleRequest(query_string))
110111
f = open(self.testdata_path + request.lower() + '.txt')
111112
expected = f.read()

tests/testdata/qgis_server/getcapabilities.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Content-Length: 5250
22
Content-Type: text/xml; charset=utf-8
33

44
<?xml version="1.0" encoding="utf-8"?>
5-
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3" 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 http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;SERVICE=WMS&amp;REQUEST=GetSchemaExtension" xmlns:sld="http://www.opengis.net/sld" xmlns:qgs="http://www.qgis.org/wms">
5+
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3" 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 http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;SERVICE=WMS&amp;REQUEST=GetSchemaExtension" xmlns:sld="http://www.opengis.net/sld" xmlns:qgs="http://www.qgis.org/wms">
66
<Service>
77
<Name>WMS</Name>
88
<Title>QGIS TestProject</Title>
@@ -26,7 +26,7 @@ Content-Type: text/xml; charset=utf-8
2626
<DCPType>
2727
<HTTP>
2828
<Get>
29-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
29+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
3030
</Get>
3131
</HTTP>
3232
</DCPType>
@@ -41,7 +41,7 @@ Content-Type: text/xml; charset=utf-8
4141
<DCPType>
4242
<HTTP>
4343
<Get>
44-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
44+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
4545
</Get>
4646
</HTTP>
4747
</DCPType>
@@ -55,7 +55,7 @@ Content-Type: text/xml; charset=utf-8
5555
<DCPType>
5656
<HTTP>
5757
<Get>
58-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
58+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
5959
</Get>
6060
</HTTP>
6161
</DCPType>
@@ -66,7 +66,7 @@ Content-Type: text/xml; charset=utf-8
6666
<DCPType>
6767
<HTTP>
6868
<Get>
69-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
69+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
7070
</Get>
7171
</HTTP>
7272
</DCPType>
@@ -76,7 +76,7 @@ Content-Type: text/xml; charset=utf-8
7676
<DCPType>
7777
<HTTP>
7878
<Get>
79-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
79+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
8080
</Get>
8181
</HTTP>
8282
</DCPType>
@@ -86,7 +86,7 @@ Content-Type: text/xml; charset=utf-8
8686
<DCPType>
8787
<HTTP>
8888
<Get>
89-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
89+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
9090
</Get>
9191
</HTTP>
9292
</DCPType>
@@ -125,7 +125,7 @@ Content-Type: text/xml; charset=utf-8
125125
<Title>default</Title>
126126
<LegendURL>
127127
<Format>image/png</Format>
128-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;&amp;SERVICE=WMS&amp;VERSION=1.3&amp;REQUEST=GetLegendGraphic&amp;LAYER=testlayer èé&amp;FORMAT=image/png&amp;STYLE=default"/>
128+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;&amp;SERVICE=WMS&amp;VERSION=1.3&amp;REQUEST=GetLegendGraphic&amp;LAYER=testlayer èé&amp;FORMAT=image/png&amp;STYLE=default"/>
129129
</LegendURL>
130130
</Style>
131131
</Layer>

tests/testdata/qgis_server/getprojectsettings.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Content-Length: 6268
22
Content-Type: text/xml; charset=utf-8
33

44
<?xml version="1.0" encoding="utf-8"?>
5-
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3.0" 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 http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;SERVICE=WMS&amp;REQUEST=GetSchemaExtension" xmlns:sld="http://www.opengis.net/sld" xmlns:qgs="http://www.qgis.org/wms">
5+
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3.0" 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 http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;SERVICE=WMS&amp;REQUEST=GetSchemaExtension" xmlns:sld="http://www.opengis.net/sld" xmlns:qgs="http://www.qgis.org/wms">
66
<Service>
77
<Name>WMS</Name>
88
<Title>QGIS TestProject</Title>
@@ -26,7 +26,7 @@ Content-Type: text/xml; charset=utf-8
2626
<DCPType>
2727
<HTTP>
2828
<Get>
29-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
29+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
3030
</Get>
3131
</HTTP>
3232
</DCPType>
@@ -41,7 +41,7 @@ Content-Type: text/xml; charset=utf-8
4141
<DCPType>
4242
<HTTP>
4343
<Get>
44-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
44+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
4545
</Get>
4646
</HTTP>
4747
</DCPType>
@@ -55,7 +55,7 @@ Content-Type: text/xml; charset=utf-8
5555
<DCPType>
5656
<HTTP>
5757
<Get>
58-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
58+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
5959
</Get>
6060
</HTTP>
6161
</DCPType>
@@ -66,7 +66,7 @@ Content-Type: text/xml; charset=utf-8
6666
<DCPType>
6767
<HTTP>
6868
<Get>
69-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
69+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
7070
</Get>
7171
</HTTP>
7272
</DCPType>
@@ -76,7 +76,7 @@ Content-Type: text/xml; charset=utf-8
7676
<DCPType>
7777
<HTTP>
7878
<Get>
79-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
79+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
8080
</Get>
8181
</HTTP>
8282
</DCPType>
@@ -86,7 +86,7 @@ Content-Type: text/xml; charset=utf-8
8686
<DCPType>
8787
<HTTP>
8888
<Get>
89-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
89+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
9090
</Get>
9191
</HTTP>
9292
</DCPType>
@@ -98,7 +98,7 @@ Content-Type: text/xml; charset=utf-8
9898
<DCPType>
9999
<HTTP>
100100
<Get>
101-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;"/>
101+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
102102
</Get>
103103
</HTTP>
104104
</DCPType>
@@ -138,7 +138,7 @@ Content-Type: text/xml; charset=utf-8
138138
<Title>default</Title>
139139
<LegendURL>
140140
<Format>image/png</Format>
141-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/testproject.qgs&amp;&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"/>
141+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;&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"/>
142142
</LegendURL>
143143
</Style>
144144
<Attributes>

0 commit comments

Comments
 (0)