Skip to content

Commit b81d8f5

Browse files
committed
Only test Geometry.is_valid when it exists
This is available only when building with Boost >= 1.56, see 22368cd
1 parent c005502 commit b81d8f5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/python_tests/feature_test.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ def test_add_geom_wkb():
3939
# POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))
4040
wkb = '010300000001000000050000000000000000003e4000000000000024400000000000002440000000000000344000000000000034400000000000004440000000000000444000000000000044400000000000003e400000000000002440'
4141
geometry = mapnik.Geometry.from_wkb(unhexlify(wkb))
42-
eq_(geometry.is_valid(), True)
43-
eq_(geometry.is_simple(), True)
42+
if hasattr(geometry, 'is_valid'):
43+
# Those are only available when python-mapnik has been built with
44+
# boost >= 1.56.
45+
eq_(geometry.is_valid(), True)
46+
eq_(geometry.is_simple(), True)
4447
eq_(geometry.envelope(), mapnik.Box2d(10.0,10.0,40.0,40.0))
4548
geometry.correct()
46-
# valid after calling correct
47-
eq_(geometry.is_valid(), True)
49+
if hasattr(geometry, 'is_valid'):
50+
# valid after calling correct
51+
eq_(geometry.is_valid(), True)
4852

4953
def test_feature_expression_evaluation():
5054
context = mapnik.Context()

0 commit comments

Comments
 (0)