add more tests for the ShieldSymbolizer

This commit is contained in:
Dane Springmeyer 2010-10-13 01:23:56 +00:00
parent a165713701
commit 5308c36bc6

View file

@ -10,6 +10,43 @@ import mapnik2, pickle
# ShieldSymbolizer initialization
def test_shieldsymbolizer_init():
s = mapnik2.ShieldSymbolizer(mapnik2.Expression('[Field Name]'), 'DejaVu Sans Bold', 6, mapnik2.Color('#000000'), mapnik2.PathExpression('../data/images/dummy.png'))
eq_(s.get_anchor(), [])
eq_(s.get_displacement(), [])
eq_(s.allow_overlap, False)
eq_(s.avoid_edges,False)
eq_(s.character_spacing,1)
eq_(ts.name, ts2.name)
eq_(ts.face_name, ts2.face_name)
eq_(ts.allow_overlap, ts2.allow_overlap)
eq_(ts.get_displacement(), ts2.get_displacement())
eq_(ts.get_anchor(), ts2.get_anchor())
eq_(ts.fill, ts2.fill)
eq_(ts.force_odd_labels, ts2.force_odd_labels)
eq_(ts.halo_fill, ts2.halo_fill)
eq_(ts.halo_radius, ts2.halo_radius)
eq_(ts.label_placement, ts2.label_placement)
eq_(ts.minimum_distance, ts2.minimum_distance)
eq_(ts.text_ratio, ts2.text_ratio)
eq_(ts.text_size, ts2.text_size)
eq_(ts.wrap_width, ts2.wrap_width)
eq_(ts.vertical_alignment, ts2.vertical_alignment)
eq_(ts.label_spacing, ts2.label_spacing)
eq_(ts.label_position_tolerance, ts2.label_position_tolerance)
eq_(ts.wrap_character, ts2.wrap_character)
eq_(ts.text_transform, ts2.text_transform)
eq_(ts.line_spacing, ts2.line_spacing)
eq_(ts.character_spacing, ts2.character_spacing)
# r1341
eq_(ts.wrap_before, ts2.wrap_before)
eq_(ts.horizontal_alignment, ts2.horizontal_alignment)
eq_(ts.justify_alignment, ts2.justify_alignment)
eq_(ts.opacity, ts2.opacity)
raise Todo("FontSet pickling support needed: http://trac.mapnik2.org/ticket/348")
eq_(ts.fontset, ts2.fontset)
# ShieldSymbolizer missing image file
# images paths are now PathExpressions are evaluated at runtime