Skip to content

Commit

Permalink
Fix port for WFS server integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Feb 22, 2018
1 parent 3142824 commit 3ce8dc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/src/python/qgis_wrapped_server.py
Expand Up @@ -167,7 +167,7 @@ def do_GET(self, post_body=None):
for k, v in self.headers.items():
headers['HTTP_%s' % k.replace(' ', '-').replace('-', '_').replace(' ', '-').upper()] = v
if not self.path.startswith('http'):
self.path = "%s://%s:%s%s" % ('https' if https else 'http', QGIS_SERVER_HOST, QGIS_SERVER_PORT, self.path)
self.path = "%s://%s:%s%s" % ('https' if https else 'http', QGIS_SERVER_HOST, self.server.server_port, self.path)
request = QgsBufferServerRequest(self.path, (QgsServerRequest.PostMethod if post_body is not None else QgsServerRequest.GetMethod), headers, post_body)
response = QgsBufferServerResponse()
qgs_server.handleRequest(request, response)
Expand Down
8 changes: 3 additions & 5 deletions tests/src/python/test_qgsserver_wfst.py
Expand Up @@ -56,10 +56,8 @@
unittest,
)

try:
QGIS_SERVER_WFST_PORT = os.environ['QGIS_SERVER_WFST_PORT']
except:
QGIS_SERVER_WFST_PORT = '0' # Auto
# 0 = auto
QGIS_SERVER_PORT = os.environ.get('QGIS_SERVER_PORT', '0')


qgis_app = start_app()
Expand All @@ -70,7 +68,7 @@ class TestWFST(unittest.TestCase):
@classmethod
def setUpClass(cls):
"""Run before all tests"""
cls.port = QGIS_SERVER_WFST_PORT
cls.port = QGIS_SERVER_PORT
# Create tmp folder
cls.temp_path = tempfile.mkdtemp()
cls.testdata_path = cls.temp_path + '/' + 'wfs_transactional' + '/'
Expand Down

0 comments on commit 3ce8dc1

Please sign in to comment.