Skip to content

Commit 3ce8dc1

Browse files
committed
Fix port for WFS server integration tests
1 parent 3142824 commit 3ce8dc1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

tests/src/python/qgis_wrapped_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def do_GET(self, post_body=None):
167167
for k, v in self.headers.items():
168168
headers['HTTP_%s' % k.replace(' ', '-').replace('-', '_').replace(' ', '-').upper()] = v
169169
if not self.path.startswith('http'):
170-
self.path = "%s://%s:%s%s" % ('https' if https else 'http', QGIS_SERVER_HOST, QGIS_SERVER_PORT, self.path)
170+
self.path = "%s://%s:%s%s" % ('https' if https else 'http', QGIS_SERVER_HOST, self.server.server_port, self.path)
171171
request = QgsBufferServerRequest(self.path, (QgsServerRequest.PostMethod if post_body is not None else QgsServerRequest.GetMethod), headers, post_body)
172172
response = QgsBufferServerResponse()
173173
qgs_server.handleRequest(request, response)

tests/src/python/test_qgsserver_wfst.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@
5656
unittest,
5757
)
5858

59-
try:
60-
QGIS_SERVER_WFST_PORT = os.environ['QGIS_SERVER_WFST_PORT']
61-
except:
62-
QGIS_SERVER_WFST_PORT = '0' # Auto
59+
# 0 = auto
60+
QGIS_SERVER_PORT = os.environ.get('QGIS_SERVER_PORT', '0')
6361

6462

6563
qgis_app = start_app()
@@ -70,7 +68,7 @@ class TestWFST(unittest.TestCase):
7068
@classmethod
7169
def setUpClass(cls):
7270
"""Run before all tests"""
73-
cls.port = QGIS_SERVER_WFST_PORT
71+
cls.port = QGIS_SERVER_PORT
7472
# Create tmp folder
7573
cls.temp_path = tempfile.mkdtemp()
7674
cls.testdata_path = cls.temp_path + '/' + 'wfs_transactional' + '/'

0 commit comments

Comments
 (0)