Skip to content

Commit

Permalink
Fix local test server response parsing and add debug output for url
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Jun 13, 2014
1 parent c1d80ed commit e257227
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/src/python/qgis_local_server.py
Expand Up @@ -430,7 +430,7 @@ def get_capabilities(self, params, browser=False):
openInBrowserTab(url)
return False, ''

success = ('perhaps you left off the .qgs extension' in xml or
success = ('error reading the project file' in xml or
'WMS_Capabilities' in xml)
return success, xml

Expand Down Expand Up @@ -525,7 +525,7 @@ def get_map(self, params, browser=False):
'No valid PNG output'
)

return success, filepath
return success, filepath, url

def process_params(self, params):
# set all keys to uppercase
Expand Down Expand Up @@ -821,7 +821,7 @@ def tearDown(self):
try:
local_srv.check_server_capabilities()
# open resultant png with system
result, png = local_srv.get_map(req_params)
result, png, url = local_srv.get_map(req_params)
finally:
local_srv.shutdown()

Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgis_local_server.py
Expand Up @@ -116,7 +116,7 @@ def test_convert_param_instances(self):
# @unittest.skip('')
def test_getmap(self):
test_name = 'qgis_local_server'
success, img_path = MAPSERV.get_map(self.getmap_params())
success, img_path, url = MAPSERV.get_map(self.getmap_params())
msg = '\nLocal server get_map failed'
assert success, msg

Expand Down
5 changes: 3 additions & 2 deletions tests/src/python/test_qgspallabeling_server.py
Expand Up @@ -177,9 +177,10 @@ def checkTest(self, **kwargs):
qDebug('MapSettings type: {0}'.format(settings_type))
qDebug(mapSettingsString(ms))

res_m, self._TestImage = MAPSERV.get_map(
self.get_request_params(), False)
res_m, self._TestImage, url = MAPSERV.get_map(self.get_request_params(), False)
# print self._TestImage.__repr__()
if 'PAL_VERBOSE' in os.environ:
qDebug('GetMap request:\n {0}\n'.format(url))
self.saveControlImage(self._TestImage)
self.assertTrue(res_m, 'Failed to retrieve/save image from test server')
mismatch = 0
Expand Down

0 comments on commit e257227

Please sign in to comment.