Skip to content
Permalink
Browse files

Some server test python3 updates

  • Loading branch information
nyalldawson committed Sep 20, 2016
1 parent 05885fa commit 4ad5038b5d868ed5fb940de3223994d9d94ca38a
Showing with 7 additions and 4 deletions.
  1. +2 −2 tests/src/python/qgis_local_server.py
  2. +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)

0 comments on commit 4ad5038

Please sign in to comment.