boolean evals of expressions return strings

This commit is contained in:
Dane Springmeyer 2011-02-28 21:20:16 +00:00
parent efb19dea6c
commit 429eed5090

View file

@ -98,13 +98,13 @@ def test_regex_match():
f = mapnik2.Feature(0) f = mapnik2.Feature(0)
f["name"] = 'test' f["name"] = 'test'
expr = mapnik2.Expression("[name].match('test')") expr = mapnik2.Expression("[name].match('test')")
eq_(expr.evaluate(f),1) # 1 == True eq_(expr.evaluate(f),'1') # 1 == True
def test_unicode_regex_match(): def test_unicode_regex_match():
f = mapnik2.Feature(0) f = mapnik2.Feature(0)
f["name"] = 'Québec' f["name"] = 'Québec'
expr = mapnik2.Expression("[name].match('Québec')") expr = mapnik2.Expression("[name].match('Québec')")
eq_(expr.evaluate(f),1) # 1 == True eq_(expr.evaluate(f),'1') # 1 == True
def test_regex_replace(): def test_regex_replace():
f = mapnik2.Feature(0) f = mapnik2.Feature(0)