From 0a68f66c35a42b92e47d6251906acd7ac490d19b Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 17 Apr 2013 13:39:11 -0700 Subject: [PATCH] fixup postgis null comparision tests --- tests/python_tests/postgis_test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/python_tests/postgis_test.py b/tests/python_tests/postgis_test.py index 71ea7b129..a5ed52ae2 100644 --- a/tests/python_tests/postgis_test.py +++ b/tests/python_tests/postgis_test.py @@ -556,7 +556,7 @@ if 'postgis' in mapnik.DatasourceCache.plugin_names() \ eq_(mapnik.Expression("[name] != 'name'").evaluate(feat),True) eq_(mapnik.Expression("[name] != ''").evaluate(feat),False) eq_(mapnik.Expression("[name] != null").evaluate(feat),True) - eq_[bool_field] + eq_(mapnik.Expression("[name] != true").evaluate(feat),True) eq_(mapnik.Expression("[name] != false").evaluate(feat),True) feat = fs.next() @@ -573,7 +573,7 @@ if 'postgis' in mapnik.DatasourceCache.plugin_names() \ eq_(mapnik.Expression("[name] != true").evaluate(feat),True) eq_(mapnik.Expression("[name] != false").evaluate(feat),True) - def test_null_comparision(): + def test_null_comparision2(): ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test10', geometry_field='geom') fs = ds.featureset() @@ -586,8 +586,8 @@ if 'postgis' in mapnik.DatasourceCache.plugin_names() \ eq_(mapnik.Expression("[bool_field] = true").evaluate(feat),True) eq_(mapnik.Expression("[bool_field] = false").evaluate(feat),False) eq_(mapnik.Expression("[bool_field] != 'name'").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != ''").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != null").evaluate(feat),True) + eq_(mapnik.Expression("[bool_field] != ''").evaluate(feat),True) # in 2.1.x used to be False + eq_(mapnik.Expression("[bool_field] != null").evaluate(feat),True) # in 2.1.x used to be False eq_(mapnik.Expression("[bool_field] != true").evaluate(feat),False) eq_(mapnik.Expression("[bool_field] != false").evaluate(feat),True) @@ -601,7 +601,7 @@ if 'postgis' in mapnik.DatasourceCache.plugin_names() \ eq_(mapnik.Expression("[bool_field] = false").evaluate(feat),True) eq_(mapnik.Expression("[bool_field] != 'name'").evaluate(feat),True) eq_(mapnik.Expression("[bool_field] != ''").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != null").evaluate(feat),True) + eq_(mapnik.Expression("[bool_field] != null").evaluate(feat),True) # in 2.1.x used to be False eq_(mapnik.Expression("[bool_field] != true").evaluate(feat),True) eq_(mapnik.Expression("[bool_field] != false").evaluate(feat),False) @@ -613,11 +613,11 @@ if 'postgis' in mapnik.DatasourceCache.plugin_names() \ eq_(mapnik.Expression("[bool_field] = null").evaluate(feat),True) eq_(mapnik.Expression("[bool_field] = true").evaluate(feat),False) eq_(mapnik.Expression("[bool_field] = false").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] != 'name'").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != ''").evaluate(feat),True) + eq_(mapnik.Expression("[bool_field] != 'name'").evaluate(feat),True) # in 2.1.x used to be False + eq_(mapnik.Expression("[bool_field] != ''").evaluate(feat),True) # in 2.1.x used to be False eq_(mapnik.Expression("[bool_field] != null").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] != true").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != false").evaluate(feat),True) + eq_(mapnik.Expression("[bool_field] != true").evaluate(feat),True) # in 2.1.x used to be False + eq_(mapnik.Expression("[bool_field] != false").evaluate(feat),True) # in 2.1.x used to be False atexit.register(postgis_takedown)