diff --git a/tests/visual_tests/images/python-Format-reference.png b/tests/visual_tests/images/python-Format-reference.png new file mode 100644 index 000000000..95a0eea9f Binary files /dev/null and b/tests/visual_tests/images/python-Format-reference.png differ diff --git a/tests/visual_tests/images/python-IfElse-reference.png b/tests/visual_tests/images/python-IfElse-reference.png new file mode 100644 index 000000000..d71da4f85 Binary files /dev/null and b/tests/visual_tests/images/python-IfElse-reference.png differ diff --git a/tests/visual_tests/images/python-List-reference.png b/tests/visual_tests/images/python-List-reference.png new file mode 100644 index 000000000..2be43fc4f Binary files /dev/null and b/tests/visual_tests/images/python-List-reference.png differ diff --git a/tests/visual_tests/images/python-MyText-reference.png b/tests/visual_tests/images/python-MyText-reference.png new file mode 100644 index 000000000..775f4bce9 Binary files /dev/null and b/tests/visual_tests/images/python-MyText-reference.png differ diff --git a/tests/visual_tests/images/python-TextNode-reference.png b/tests/visual_tests/images/python-TextNode-reference.png new file mode 100644 index 000000000..db6bfa228 Binary files /dev/null and b/tests/visual_tests/images/python-TextNode-reference.png differ diff --git a/tests/visual_tests/test_python.py b/tests/visual_tests/test_python.py index ac5165c1d..a452f3a87 100755 --- a/tests/visual_tests/test_python.py +++ b/tests/visual_tests/test_python.py @@ -2,9 +2,10 @@ import mapnik import sys import os.path -from compare import compare, summary +from compare import compare dirname = os.path.dirname(__file__) +visual_output_dir = "/tmp/mapnik-visual-images" class MyText(mapnik.FormattingNode): def __init__(self): @@ -71,7 +72,7 @@ m.append_style('Style', style) layer = mapnik.Layer('Layer') -layer.datasource = mapnik.Datasource(**{file=os.path.join(dirname,"data/points.csv")) +layer.datasource = mapnik.Datasource(**{'type':'csv','file':os.path.join(dirname,"data/points.csv")}) layer.styles.append('Style') m.layers.append(layer) @@ -99,9 +100,10 @@ format_trees = [ for format_tree in format_trees: text.placements.defaults.format_tree = format_tree[1] - mapnik.render_to_file(m, os.path.join(dirname,"images", 'python-%s.png' % format_tree[0]), 'png') - compare(os.path.join(dirname,"images", 'python-%s.png' % format_tree[0]), - os.path.join(dirname,"images", 'python-%s-reference.png' % format_tree[0]) - ) + actual = os.path.join(visual_output_dir, 'python-%s.png' % format_tree[0]) + expected = os.path.join(dirname,"images", 'python-%s-reference.png' % format_tree[0]) + mapnik.render_to_file(m, actual, 'png8:m=h') + diff = compare(actual,expected) + if diff > 1: + print 'comparision failed between:\n %s (actual)\n %s (expected)' % (actual,expected) -summary()