diff --git a/tests/data/sqlite/empty.db b/tests/data/sqlite/empty.db new file mode 100644 index 000000000..98816e6c2 Binary files /dev/null and b/tests/data/sqlite/empty.db differ diff --git a/tests/python_tests/sqlite_test.py b/tests/python_tests/sqlite_test.py index 464c9690f..0a99bfa33 100644 --- a/tests/python_tests/sqlite_test.py +++ b/tests/python_tests/sqlite_test.py @@ -196,6 +196,15 @@ if 'sqlite' in mapnik2.DatasourceCache.instance().plugin_names(): eq_(feature['rowid'],1) eq_(feature['fips'],u'AC') + + def test_empty_db(): + ds = mapnik2.SQLite(file='../data/sqlite/empty.db', + table='empty', + ) + fs = ds.featureset() + feature = fs.next() + eq_(feature,None) + if __name__ == "__main__": setup() [eval(run)() for run in dir() if 'test_' in run]