mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
update feature expression test to new feature attr api that will throw if attr is not found
This commit is contained in:
parent
a13b3f650c
commit
da845cfaa3
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user