From da845cfaa37a4d7a5eddf4c245eaeb35ec5fecb8 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 14 Feb 2012 14:57:36 -0800 Subject: [PATCH] update feature expression test to new feature attr api that will throw if attr is not found --- tests/python_tests/feature_test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/python_tests/feature_test.py b/tests/python_tests/feature_test.py index 43ff7d581..a15b195dd 100644 --- a/tests/python_tests/feature_test.py +++ b/tests/python_tests/feature_test.py @@ -67,8 +67,11 @@ def test_feature_expression_evaluation_missing_attr(): f['name'] = u'a' eq_(f['name'],u'a') expr = mapnik.Expression("[fielddoesnotexist]='a'") - evaluated = expr.evaluate(f) - eq_(evaluated,False) + eq_(f.has_key('fielddoesnotexist'),False) + try: + evaluated = expr.evaluate(f) + except Exception, e: + eq_("Key does not exist" in str(e),True) num_attributes = len(f) eq_(num_attributes,1) eq_(f.id(),1)