move over other colortable test to visual tests

This commit is contained in:
Dane Springmeyer 2013-09-25 14:02:52 -07:00
parent cb80fb8226
commit 8d79008e9e
8 changed files with 74 additions and 41 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

View file

@ -1,40 +0,0 @@
#coding=utf8
import os
import mapnik
from utilities import execution_path, run_all
from nose.tools import *
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
if 'gdal' in mapnik.DatasourceCache.plugin_names():
def test_vrt_rendering():
m = mapnik.Map(512,512)
mapnik.load_map(m,'../data/good_maps/vrt_colortable.xml')
m.zoom_all()
im = mapnik.Image(512,512)
mapnik.render(m,im)
actual = '/tmp/vrt_colortable.png'
expected = 'images/support/vrt_colortable.png'
im.save(actual)
expected_im = mapnik.Image.open(expected)
eq_(im.tostring(),expected_im.tostring(), 'failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected))
def test_tif_rendering_nodata():
m = mapnik.Map(512,512)
mapnik.load_map(m,'../data/good_maps/tiff_colortable.xml')
m.zoom_all()
im = mapnik.Image(512,512)
mapnik.render(m,im)
actual = '/tmp/tif_colortable.png'
expected = 'images/support/tif_colortable.png'
im.save(actual)
expected_im = mapnik.Image.open(expected)
eq_(im.tostring(),expected_im.tostring(), 'failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected))
if __name__ == "__main__":
setup()
run_all(eval(x) for x in dir() if x.startswith("test_"))

View file

@ -0,0 +1,72 @@
{
"keys": [
""
],
"data": {},
"grid": [
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -8,7 +8,7 @@
<Layer name="2011_5km_vrt_nodata" srs="+init=epsg:32630">
<StyleName>2011_5km_vrt_nodata_style</StyleName>
<Datasource>
<Parameter name="file">../raster/dataraster.vrt</Parameter>
<Parameter name="file">../../data/raster/dataraster.vrt</Parameter>
<Parameter name="type">gdal</Parameter>
</Datasource>
</Layer>

View file

@ -176,6 +176,7 @@ files = {
'dst-over-compositing':{'sizes':[(512,512)]},
'tiff_colortable':{'sizes':[(256,256)]},
'tiff_colortable_custom_nodata':{'sizes':[(256,256)]},
'vrt_colortable':{'sizes':[(256,256)]},
}
class Reporting: