Permalink
Browse files

add python test: set ShieldSymbolizer's transform

  • Loading branch information...
1 parent 1e3c48a commit 2a7634693f804e3d5e0578098c80cf1605883874 @lightmare lightmare committed Jun 7, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 tests/python_tests/object_test.py
@@ -68,7 +68,8 @@ def test_shieldsymbolizer_init():
# strings for PathExpressions... should we pass objects?
eq_(s.filename, '../data/images/dummy.png')
- eq_(s.transform, 'matrix(1, 0, 0, 1, 0, 0)')
+ # 11c34b1: default transform list is empty, not identity matrix
+ eq_(s.transform, '')
eq_(len(s.fontset.names), 0)
@@ -79,6 +80,13 @@ def test_shieldsymbolizer_init():
#def test_shieldsymbolizer_missing_image():
# s = mapnik.ShieldSymbolizer(mapnik.Expression('[Field Name]'), 'DejaVu Sans Bold', 6, mapnik.Color('#000000'), mapnik.PathExpression('../#data/images/broken.png'))
+# ShieldSymbolizer modification
+def test_shieldsymbolizer_modify():
+ s = mapnik.ShieldSymbolizer(mapnik.Expression('[Field Name]'), 'DejaVu Sans Bold', 6, mapnik.Color('#000000'), mapnik.PathExpression('../data/images/dummy.png'))
+ # transform expression
+ s.transform = "rotate(30+[a]) scale(2*[sx] [sy])"
+ eq_(s.transform, "rotate((30+[a])) scale(2*[sx], [sy])")
+
def test_polygonsymbolizer_init():
p = mapnik.PolygonSymbolizer()

0 comments on commit 2a76346

Please sign in to comment.