Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Some server test python3 updates
- Loading branch information
Showing
with
7 additions
and
4 deletions.
-
+2
−2
tests/src/python/qgis_local_server.py
-
+5
−2
tests/src/python/test_qgsserver.py
|
@@ -425,7 +425,7 @@ def get_capabilities(self, params, browser=False): |
|
|
url = self._fcgi_url + '?' + self.process_params(params) |
|
|
|
|
|
res = urllib.request.urlopen(url) |
|
|
xml = res.read() |
|
|
xml = res.read().decode('utf-8') |
|
|
if browser: |
|
|
tmp_name = getTempfilePath('html') |
|
|
with open(tmp_name, 'wt') as temp_html: |
|
@@ -732,7 +732,7 @@ def tearDown(self): |
|
|
# print repr(res) |
|
|
assert (res is not None |
|
|
and res.getcode() == 200 |
|
|
and 'Web Server Working' in res.read()), msg |
|
|
and 'Web Server Working' in res.read().decode('utf-8')), msg |
|
|
|
|
|
# verify basic wms service |
|
|
params = { |
|
|
|
@@ -18,7 +18,7 @@ |
|
|
import urllib.request |
|
|
import urllib.parse |
|
|
import urllib.error |
|
|
from mimetools import Message |
|
|
import email |
|
|
from io import StringIO |
|
|
from qgis.server import QgsServer |
|
|
from qgis.core import QgsMessageLog |
|
@@ -45,7 +45,10 @@ def setUp(self): |
|
|
self.server = QgsServer() |
|
|
|
|
|
def assert_headers(self, header, body): |
|
|
headers = Message(StringIO(header)) |
|
|
stream = StringIO() |
|
|
header_string = header.decode('utf-8') |
|
|
stream.write(header_string) |
|
|
headers = email.message_from_string(header_string) |
|
|
if 'content-length' in headers: |
|
|
content_length = int(headers['content-length']) |
|
|
body_length = len(body) |
|
|