add test ensuring we can still parse deprecated styling properties
This commit is contained in:
parent
ad3e214beb
commit
32586c6462
2 changed files with 28 additions and 0 deletions
7
tests/data/deprecated_maps/marker-type.xml
Normal file
7
tests/data/deprecated_maps/marker-type.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<Map>
|
||||
<Style name="deprecated">
|
||||
<Rule>
|
||||
<MarkersSymbolizer marker-type="ellipse" />
|
||||
</Rule>
|
||||
</Style>
|
||||
</Map>
|
|
@ -37,6 +37,27 @@ def test_broken_files():
|
|||
eq_(len(failures),0,'\n'+'\n'.join(failures))
|
||||
mapnik.logger.set_severity(default_logging_severity)
|
||||
|
||||
def test_can_parse_xml_with_deprecated_properties():
|
||||
default_logging_severity = mapnik.logger.get_severity()
|
||||
mapnik.logger.set_severity(mapnik.severity_type.None)
|
||||
broken_files = glob.glob("../data/deprecated_maps/*.xml")
|
||||
|
||||
failures = [];
|
||||
for filename in broken_files:
|
||||
try:
|
||||
m = mapnik.Map(512, 512)
|
||||
strict = True
|
||||
mapnik.load_map(m, filename, strict)
|
||||
base_path = os.path.dirname(filename)
|
||||
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) \
|
||||
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))
|
||||
mapnik.logger.set_severity(default_logging_severity)
|
||||
|
||||
def test_good_files():
|
||||
good_files = glob.glob("../data/good_maps/*.xml")
|
||||
good_files.extend(glob.glob("../visual_tests/styles/*.xml"))
|
||||
|
|
Loading…
Add table
Reference in a new issue