diff --git a/tests/python_tests/images/support/dataraster_coloring.png b/tests/python_tests/images/support/dataraster_coloring.png new file mode 100644 index 000000000..da3cac4b1 Binary files /dev/null and b/tests/python_tests/images/support/dataraster_coloring.png differ diff --git a/tests/python_tests/images/support/raster_warping.png b/tests/python_tests/images/support/raster_warping.png new file mode 100644 index 000000000..2061d7bca Binary files /dev/null and b/tests/python_tests/images/support/raster_warping.png differ diff --git a/tests/python_tests/images/support/raster_warping_does_not_overclip_source.png b/tests/python_tests/images/support/raster_warping_does_not_overclip_source.png new file mode 100644 index 000000000..0d6ccc5ab Binary files /dev/null and b/tests/python_tests/images/support/raster_warping_does_not_overclip_source.png differ diff --git a/tests/python_tests/raster_symbolizer_test.py b/tests/python_tests/raster_symbolizer_test.py index 2c7ba1d19..b81e7c145 100644 --- a/tests/python_tests/raster_symbolizer_test.py +++ b/tests/python_tests/raster_symbolizer_test.py @@ -52,9 +52,14 @@ def test_dataraster_coloring(): im = mapnik.Image(_map.width,_map.height) mapnik.render(_map, im) - imdata = im.tostring() - # we have some values in the [20,30) interval so check that they're colored - assert contains_word('\xff\xff\x00\xff', imdata) + expected_file = './images/support/dataraster_coloring.png' + actual_file = '/tmp/' + os.path.basename(expected_file) + im.save(actual_file,'png32') + if not os.path.exists(expected_file) or os.environ.get('UPDATE'): + im.save(expected_file,'png32') + actual = mapnik.Image.open(actual_file) + expected = mapnik.Image.open(expected_file) + eq_(actual.tostring('png32'),expected.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual_file,expected_file)) def test_dataraster_query_point(): srs = '+init=epsg:32630' @@ -165,8 +170,14 @@ def test_raster_warping(): im = mapnik.Image(_map.width,_map.height) mapnik.render(_map, im) - imdata = im.tostring() - assert contains_word('\xff\xff\x00\xff', imdata) + expected_file = './images/support/raster_warping.png' + actual_file = '/tmp/' + os.path.basename(expected_file) + im.save(actual_file,'png32') + if not os.path.exists(expected_file) or os.environ.get('UPDATE'): + im.save(expected_file,'png32') + actual = mapnik.Image.open(actual_file) + expected = mapnik.Image.open(expected_file) + eq_(actual.tostring('png32'),expected.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual_file,expected_file)) def test_raster_warping_does_not_overclip_source(): lyrSrs = "+init=epsg:32630" @@ -192,7 +203,14 @@ def test_raster_warping_does_not_overclip_source(): im = mapnik.Image(_map.width,_map.height) mapnik.render(_map, im) - assert im.view(0,200,1,1).tostring()=='\xff\xff\x00\xff' + expected_file = './images/support/raster_warping_does_not_overclip_source.png' + actual_file = '/tmp/' + os.path.basename(expected_file) + im.save(actual_file,'png32') + if not os.path.exists(expected_file) or os.environ.get('UPDATE'): + im.save(expected_file,'png32') + actual = mapnik.Image.open(actual_file) + expected = mapnik.Image.open(expected_file) + eq_(actual.tostring('png32'),expected.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual_file,expected_file)) if __name__ == "__main__": setup()