skip load/save map tests when postgis is not running

This commit is contained in:
Dane Springmeyer 2014-09-24 17:36:50 -07:00
parent 18910f4c44
commit fb60492696
2 changed files with 4 additions and 2 deletions

View file

@ -51,7 +51,8 @@ def test_good_files():
mapnik.load_map_from_string(m,open(filename,'rb').read(),strict,base_path)
except RuntimeError, e:
# only test datasources that we have installed
if not 'Could not create datasource' in str(e):
if not 'Could not create datasource' in str(e) \
and not 'Bad connection' in str(e):
failures.append('Failed to load valid map %s (%s)' % (filename,e))
eq_(len(failures),0,'\n'+'\n'.join(failures))

View file

@ -26,7 +26,8 @@ def compare_map(xml):
mapnik.load_map(m, xml, False, absolute_base)
except RuntimeError, e:
# only test datasources that we have installed
if not 'Could not create datasource' in str(e):
if not 'Could not create datasource' in str(e) \
and not 'Bad connection' in str(e):
raise RuntimeError(str(e))
return
(handle, test_map) = tempfile.mkstemp(suffix='.xml', prefix='mapnik-temp-map1-')