#
# This file is part of Nominatim. (https://nominatim.org)
#
-# Copyright (C) 2024 by the Nominatim developer community.
+# Copyright (C) 2025 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for specialised connection and cursor classes.
import nominatim_db.db.connection as nc
+
@pytest.fixture
def db(dsn):
with nc.connect(dsn) as conn:
assert nc.table_has_column(db, 'stuff', name) == result
+
def test_connection_index_exists(db, table_factory, temp_db_cursor):
assert not nc.index_exists(db, 'some_index')
with pytest.raises(psycopg.ProgrammingError, match='.*does not exist.*'):
nc.drop_tables(db, 'dfkjgjriogjigjgjrdghehtre', if_exists=False)
+
def test_connection_server_version_tuple(db):
ver = nc.server_version_tuple(db)