more pep8 for tests

This commit is contained in:
Dane Springmeyer 2012-02-24 13:15:48 -08:00
parent 0a37a1591e
commit 3839dd363f
6 changed files with 0 additions and 25 deletions

View file

@ -7,7 +7,6 @@ from utilities import execution_path
import os, mapnik
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
@ -116,7 +115,6 @@ if 'csv' in mapnik.DatasourceCache.instance().plugin_names():
eq_(fs[7].geometries()[0].type(),mapnik.DataGeometryType.Polygon)
eq_(ds.describe(),{'geometry_type': mapnik.DataGeometryType.Collection, 'type': mapnik.DataType.Vector, 'name': 'csv', 'encoding': 'utf-8'})
def test_handling_of_missing_header(**kwargs):
ds = get_csv_ds('missing_header.csv')
eq_(len(ds.fields()),6)

View file

@ -72,7 +72,6 @@ def test_shieldsymbolizer_init():
eq_(len(s.fontset.names), 0)
# ShieldSymbolizer missing image file
# images paths are now PathExpressions are evaluated at runtime
# so it does not make sense to throw...
@ -121,7 +120,6 @@ def test_pointsymbolizer_init():
#def test_pointsymbolizer_missing_image():
# p = mapnik.PointSymbolizer(mapnik.PathExpression("../data/images/broken.png"))
# PolygonSymbolizer initialization
def test_polygonsymbolizer_init():
p = mapnik.PolygonSymbolizer()
@ -164,7 +162,6 @@ def test_stroke_dash_arrays():
eq_(s.get_dashes(), [(1,2),(3,4),(5,6)])
# LineSymbolizer initialization
def test_linesymbolizer_init():
l = mapnik.LineSymbolizer()
@ -192,7 +189,6 @@ def test_linesymbolizer_init():
eq_(l.stroke.line_cap, mapnik.line_cap.BUTT_CAP)
eq_(l.stroke.line_join, mapnik.line_join.MITER_JOIN)
# TextSymbolizer initialization
def test_textsymbolizer_init():
ts = mapnik.TextSymbolizer(mapnik.Expression('[Field_Name]'), 'Font Name', 8, mapnik.Color('black'))
@ -338,7 +334,6 @@ def test_color_equality():
c2 = mapnik.Color(0,0,255)
c3 = mapnik.Color('black')
c3.r = 0
c3.g = 0
c3.b = 255
@ -387,7 +382,6 @@ def test_color_equality():
eq_(c2, mapnik.Color('lime'))
eq_(c3, mapnik.Color(0,0,255,128))
# Rule initialization
def test_rule_init():
min_scale = 5

View file

@ -26,7 +26,6 @@ def test_pointsymbolizer_pickle():
eq_(p.ignore_placement, p2.ignore_placement)
eq_(p.placement, p2.placement)
# PolygonSymbolizer pickling
def test_polygonsymbolizer_pickle():
p = mapnik.PolygonSymbolizer(mapnik.Color('black'))
@ -37,7 +36,6 @@ def test_polygonsymbolizer_pickle():
eq_(p.fill, p2.fill)
eq_(p.fill_opacity, p2.fill_opacity)
# Stroke pickling
def test_stroke_pickle():
s = mapnik.Stroke(mapnik.Color('black'),4.5)
@ -70,8 +68,6 @@ def test_linesymbolizer_pickle():
eq_(s.line_cap, s2.line_cap)
eq_(s.line_join, s2.line_join)
# TextSymbolizer pickling
def test_textsymbolizer_pickle():
raise Todo("text_symbolizer pickling currently disabled")
@ -82,7 +78,6 @@ def test_textsymbolizer_pickle():
eq_(ts.text_size, 8)
eq_(ts.fill, mapnik.Color('black'))
ts2 = pickle.loads(pickle.dumps(ts,pickle.HIGHEST_PROTOCOL))
eq_(ts.name, ts2.name)
eq_(ts.face_name, ts2.face_name)
@ -120,7 +115,6 @@ def test_textsymbolizer_pickle():
eq_(len(ts.fontset.names), 0)
def test_map_pickle():
# Fails due to scale() not matching, possibly other things
raise(Todo("Map does not support pickling yet (Tickets #345)."))
@ -146,13 +140,11 @@ def test_color_pickle():
eq_(pickle.loads(pickle.dumps(c)), c)
def test_envelope_pickle():
e = mapnik.Box2d(100, 100, 200, 200)
eq_(pickle.loads(pickle.dumps(e)), e)
if __name__ == "__main__":
setup()
[eval(run)() for run in dir() if 'test_' in run]

View file

@ -182,7 +182,6 @@ if 'postgis' in mapnik.DatasourceCache.instance().plugin_names() \
query.add_property_name('bogus')
fs = ds.features(query)
atexit.register(postgis_takedown)
if __name__ == "__main__":

View file

@ -35,8 +35,6 @@ def test_get_color_discrete():
colorizer.add_stop(10, mapnik.Color(100,100,100,100));
colorizer.add_stop(20, mapnik.Color(200,200,200,200));
#should be default colour
eq_(colorizer.get_color(-50), mapnik.Color(0,0,0,0));
eq_(colorizer.get_color(0), mapnik.Color(0,0,0,0));
@ -70,9 +68,6 @@ def test_get_color_exact():
#should be stop 2
eq_(colorizer.get_color(20), mapnik.Color(200,200,200,200));
#test linear colorizer mode
def test_get_color_linear():
#setup
@ -99,7 +94,6 @@ def test_get_color_linear():
#after stop 2
eq_(colorizer.get_color(100), mapnik.Color(200,200,200,200));
def test_stop_label():
stop = mapnik.ColorizerStop(1, mapnik.COLORIZER_LINEAR, mapnik.Color('red'))
assert not stop.label

View file

@ -266,7 +266,6 @@ if 'sqlite' in mapnik.DatasourceCache.instance().plugin_names():
eq_(feature['rowid'],1)
eq_(feature['fips'],u'AC')
def test_empty_db():
ds = mapnik.SQLite(file='../data/sqlite/empty.db',
table='empty',
@ -314,7 +313,6 @@ if 'sqlite' in mapnik.DatasourceCache.instance().plugin_names():
feature = fs.next()
eq_(feature,None)
if __name__ == "__main__":
setup()
[eval(run)() for run in dir() if 'test_' in run]