update feature expression test to new feature attr api that will throw if attr is not found

This commit is contained in:
Dane Springmeyer 2012-02-14 14:57:36 -08:00
parent a13b3f650c
commit da845cfaa3

View File

@ -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)