move over other colortable test to visual tests
This commit is contained in:
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 |
|
@ -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_"))
|
|
|
@ -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 |
|
@ -8,7 +8,7 @@
|
||||||
<Layer name="2011_5km_vrt_nodata" srs="+init=epsg:32630">
|
<Layer name="2011_5km_vrt_nodata" srs="+init=epsg:32630">
|
||||||
<StyleName>2011_5km_vrt_nodata_style</StyleName>
|
<StyleName>2011_5km_vrt_nodata_style</StyleName>
|
||||||
<Datasource>
|
<Datasource>
|
||||||
<Parameter name="file">../raster/dataraster.vrt</Parameter>
|
<Parameter name="file">../../data/raster/dataraster.vrt</Parameter>
|
||||||
<Parameter name="type">gdal</Parameter>
|
<Parameter name="type">gdal</Parameter>
|
||||||
</Datasource>
|
</Datasource>
|
||||||
</Layer>
|
</Layer>
|
|
@ -176,6 +176,7 @@ files = {
|
||||||
'dst-over-compositing':{'sizes':[(512,512)]},
|
'dst-over-compositing':{'sizes':[(512,512)]},
|
||||||
'tiff_colortable':{'sizes':[(256,256)]},
|
'tiff_colortable':{'sizes':[(256,256)]},
|
||||||
'tiff_colortable_custom_nodata':{'sizes':[(256,256)]},
|
'tiff_colortable_custom_nodata':{'sizes':[(256,256)]},
|
||||||
|
'vrt_colortable':{'sizes':[(256,256)]},
|
||||||
}
|
}
|
||||||
|
|
||||||
class Reporting:
|
class Reporting:
|
||||||
|
|
Loading…
Reference in a new issue