Skip to content
Browse files

remove the uneeded save_data test utility function

  • Loading branch information...
1 parent b9b97ba commit 35a10d48cc98ed5c262a68cfd0340ab9c3ac2a4d @springmeyer springmeyer committed Sep 26, 2012
View
4 tests/python_tests/multi_tile_raster_test.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
from nose.tools import *
-from utilities import execution_path, save_data, contains_word
+from utilities import execution_path, contains_word
import os, mapnik
@@ -40,8 +40,6 @@ def test_multi_tile_policy():
im = mapnik.Image(_map.width, _map.height)
mapnik.render(_map, im)
- save_data('test_multi_tile_policy.png', im.tostring('png'))
-
# test green chunk
eq_(im.view(0,64,1,1).tostring(), '\x00\xff\x00\xff')
eq_(im.view(127,64,1,1).tostring(), '\x00\xff\x00\xff')
View
11 tests/python_tests/raster_symbolizer_test.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
from nose.tools import *
-from utilities import execution_path, save_data, contains_word
+from utilities import execution_path, contains_word
import os, mapnik
@@ -51,8 +51,6 @@ def test_dataraster_coloring():
im = mapnik.Image(_map.width,_map.height)
mapnik.render(_map, im)
- # save a png somewhere so we can see it
- save_data('test_dataraster_coloring.png', im.tostring('png'))
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)
@@ -135,8 +133,6 @@ def test_raster_with_alpha_blends_correctly_with_background():
mim = mapnik.Image(WIDTH, HEIGHT)
mapnik.render(map, mim)
- save_data('test_raster_with_alpha_blends_correctly_with_background.png',
- mim.tostring('png'))
imdata = mim.tostring()
# All white is expected
assert contains_word('\xff\xff\xff\xff', imdata)
@@ -166,8 +162,6 @@ def test_raster_warping():
im = mapnik.Image(_map.width,_map.height)
mapnik.render(_map, im)
- # save a png somewhere so we can see it
- save_data('test_raster_warping.png', im.tostring('png'))
imdata = im.tostring()
assert contains_word('\xff\xff\x00\xff', imdata)
@@ -195,9 +189,6 @@ def test_raster_warping_does_not_overclip_source():
im = mapnik.Image(_map.width,_map.height)
mapnik.render(_map, im)
- # save a png somewhere so we can see it
- save_data('test_raster_warping_does_not_overclip_source.png',
- im.tostring('png'))
assert im.view(0,200,1,1).tostring()=='\xff\xff\x00\xff'
if __name__ == "__main__":
View
14 tests/python_tests/utilities.py
@@ -15,20 +15,6 @@ class TodoPlugin(ErrorClassPlugin):
todo = ErrorClass(Todo, label='TODO', isfailure=False)
-def save_data(filename, data, key='MAPNIK_TEST_DATA_DIR'):
- """Saves bytestring 'data' into os.environ[key]/filename if
- key in os.environ"""
- if key in os.environ:
- dir = os.environ[key]
- if not os.path.exists(dir):
- os.makedirs(dir)
- fname = os.path.join(dir, filename)
- f = open(fname, 'w')
- try:
- f.write(data)
- finally:
- f.close()
-
def contains_word(word, bytestring_):
"""
Checks that a bytestring contains a given word. len(bytestring) should be

0 comments on commit 35a10d4

Please sign in to comment.
Something went wrong with that request. Please try again.