Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixup cherry pick of ae69ee9 to 2.1.x from master

  • Loading branch information...
commit e99f8be047d89f79ea2f854ddbe8c7d96c1bef27 1 parent 66aaa4f
Artem Pavlenko artemp authored springmeyer committed
22 tests/python_tests/filter_test.py
View
@@ -20,9 +20,9 @@
<![CDATA[
- ([region] >= 0)
+ ([region] >= 0)
- and
+ and
([region] <= 50)
]]>
@@ -49,7 +49,7 @@
</Style>
</Map>'''
-def test_filter_init():
+def test_filter_init():
m = mapnik.Map(1,1)
mapnik.load_map_from_string(m,map_)
filters = []
@@ -74,7 +74,7 @@ def test_filter_init():
0)
and
([region]
- <=
+ <=
50)
'''))
@@ -169,13 +169,17 @@ def test_float_precision():
context = mapnik.Context()
context.push('num')
f = mapnik.Feature(context,0)
- f["num"] = 1.0000
- eq_(f["num"],1.0000)
- expr = mapnik.Expression("[num] = 1.0000")
+ f["num1"] = 1.0000
+ f["num2"] = 1.0001
+ eq_(f["num1"],1.0000)
+ eq_(f["num2"],1.0001)
+ expr = mapnik.Expression("[num1] = 1.0000")
eq_(expr.evaluate(f),True)
- expr = mapnik.Expression("[num].match('.*0$')")
+ expr = mapnik.Expression("[num1].match('1')")
eq_(expr.evaluate(f),True)
- expr = mapnik.Expression("[num].match('.*0$')")
+ expr = mapnik.Expression("[num2] = 1.0001")
+ eq_(expr.evaluate(f),True)
+ expr = mapnik.Expression("[num2].match('1.0001')")
eq_(expr.evaluate(f),True)
def test_string_matching_on_precision():
4 tests/python_tests/geometry_io_test.py
View
@@ -14,7 +14,7 @@ def setup():
wkts = [
[1,"POINT(30 10)"],
- [1,"POINT(30.0 10.0)"],
+ [1,"POINT(30 10)"],
[1,"POINT(30.1 10.1)"],
[1,"LINESTRING(30 10,10 30,40 40)"],
[1,"POLYGON((30 10,10 20,20 40,40 40,30 10))"],
@@ -61,7 +61,7 @@ def setup():
]
geojson = [
-[1,'{"type":"Point","coordinates":[30.0,10.0]}'],
+[1,'{"type":"Point","coordinates":[30,10]}'],
[1,'{"type":"Point","coordinates":[30.0,10.0]}'],
[1,'{"type":"Point","coordinates":[30.1,10.1]}'],
[1,'{"type":"LineString","coordinates":[[30.0,10.0],[10.0,30.0],[40.0,40.0]]}'],
6 tests/python_tests/object_test.py
View
@@ -170,11 +170,11 @@ def test_shield_symbolizer_modify():
def check_transform(expr, expect_str=None):
s.transform = expr
eq_(s.transform, expr if expect_str is None else expect_str)
- check_transform("matrix(1 2 3 4 5 6)", "matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)")
+ check_transform("matrix(1 2 3 4 5 6)", "matrix(1, 2, 3, 4, 5, 6)")
check_transform("matrix(1, 2, 3, 4, 5, 6 +7)", "matrix(1, 2, 3, 4, 5, (6+7))")
check_transform("rotate([a])")
check_transform("rotate([a] -2)", "rotate(([a]-2))")
- check_transform("rotate([a] -2 -3)", "rotate([a], -2.0, -3.0)")
+ check_transform("rotate([a] -2 -3)", "rotate([a], -2, -3)")
check_transform("rotate([a] -2 -3 -4)", "rotate(((([a]-2)-3)-4))")
check_transform("rotate([a] -2, 3, 4)", "rotate(([a]-2), 3, 4)")
check_transform("translate([tx]) rotate([a])")
@@ -219,7 +219,7 @@ def test_markers_symbolizer():
eq_(p.transform,'')
eq_(p.clip,True)
eq_(p.comp_op,mapnik.CompositeOp.src_over)
-
+
p.width = mapnik.Expression('12')
p.height = mapnik.Expression('12')
Please sign in to comment.
Something went wrong with that request. Please try again.