X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/71249bd94a1bd698a937983663f06a9376629ae6..3742fa2929619a4c54a50d3e79e0eeadb4d6ca6f:/test/python/mock_icu_word_table.py diff --git a/test/python/mock_icu_word_table.py b/test/python/mock_icu_word_table.py index 5c465e8b..67be1892 100644 --- a/test/python/mock_icu_word_table.py +++ b/test/python/mock_icu_word_table.py @@ -8,6 +8,7 @@ Legacy word table for testing with functions to prefil and test contents of the table. """ +from nominatim_db.db.connection import execute_scalar class MockIcuWordTable: """ A word table for testing using legacy word table structure. @@ -77,18 +78,15 @@ class MockIcuWordTable: def count(self): - with self.conn.cursor() as cur: - return cur.scalar("SELECT count(*) FROM word") + return execute_scalar(self.conn, "SELECT count(*) FROM word") def count_special(self): - with self.conn.cursor() as cur: - return cur.scalar("SELECT count(*) FROM word WHERE type = 'S'") + return execute_scalar(self.conn, "SELECT count(*) FROM word WHERE type = 'S'") def count_housenumbers(self): - with self.conn.cursor() as cur: - return cur.scalar("SELECT count(*) FROM word WHERE type = 'H'") + return execute_scalar(self.conn, "SELECT count(*) FROM word WHERE type = 'H'") def get_special(self):