add test for #2240

This commit is contained in:
Dane Springmeyer 2014-06-17 22:19:17 -07:00
parent 8b97c8a7d1
commit 1f81ee09d4

View file

@ -431,6 +431,15 @@ def test_truthyness_comparision():
eq_(mapnik.Expression("[prop] = true").to_bool(f),True)
eq_(mapnik.Expression("[prop] != true").to_bool(f),False)
def test_division_by_zero():
expr = mapnik.Expression('[a]/[b]')
c = mapnik.Context()
c.push('a')
c.push('b')
f = mapnik.Feature(c,0);
f['a'] = 1
f['b'] = 0
eq_(expr.evaluate(f),None)
if __name__ == "__main__":
run_all(eval(x) for x in dir() if x.startswith("test_"))