X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/139cea5720e3b1030ec9a10c678d723752d707f4..4da4cbfe27a576ae011430b2de205c74435e241b:/test/python/db/test_status.py diff --git a/test/python/db/test_status.py b/test/python/db/test_status.py index 67cd22e9..77135a8c 100644 --- a/test/python/db/test_status.py +++ b/test/python/db/test_status.py @@ -11,8 +11,8 @@ import datetime as dt import pytest -import nominatim_core.db.status -from nominatim_core.errors import UsageError +import nominatim_db.db.status +from nominatim_db.errors import UsageError OSM_NODE_DATA = """\ @@ -22,7 +22,7 @@ OSM_NODE_DATA = """\ """ def iso_date(date): - return dt.datetime.strptime(date, nominatim_core.db.status.ISODATE_FORMAT)\ + return dt.datetime.strptime(date, nominatim_db.db.status.ISODATE_FORMAT)\ .replace(tzinfo=dt.timezone.utc) @@ -36,7 +36,7 @@ def test_compute_database_date_from_osm2pgsql(table_factory, temp_db_conn, offli table_factory('osm2pgsql_properties', 'property TEXT, value TEXT', content=(('current_timestamp', '2024-01-03T23:45:54Z'), )) - date = nominatim_core.db.status.compute_database_date(temp_db_conn, offline=offline) + date = nominatim_db.db.status.compute_database_date(temp_db_conn, offline=offline) assert date == iso_date('2024-01-03T23:45:54') @@ -44,12 +44,12 @@ def test_compute_database_date_from_osm2pgsql_nodata(table_factory, temp_db_conn table_factory('osm2pgsql_properties', 'property TEXT, value TEXT') with pytest.raises(UsageError, match='Cannot determine database date from data in offline mode'): - nominatim_core.db.status.compute_database_date(temp_db_conn, offline=True) + nominatim_db.db.status.compute_database_date(temp_db_conn, offline=True) def test_compute_database_date_place_empty(place_table, temp_db_conn): with pytest.raises(UsageError): - nominatim_core.db.status.compute_database_date(temp_db_conn) + nominatim_db.db.status.compute_database_date(temp_db_conn) def test_compute_database_date_valid(monkeypatch, place_row, temp_db_conn): @@ -60,9 +60,9 @@ def test_compute_database_date_valid(monkeypatch, place_row, temp_db_conn): requested_url.append(url) return OSM_NODE_DATA - monkeypatch.setattr(nominatim_core.db.status, "get_url", mock_url) + monkeypatch.setattr(nominatim_db.db.status, "get_url", mock_url) - date = nominatim_core.db.status.compute_database_date(temp_db_conn) + date = nominatim_db.db.status.compute_database_date(temp_db_conn) assert requested_url == ['https://www.openstreetmap.org/api/0.6/node/45673/1'] assert date == iso_date('2006-01-27T22:09:10') @@ -76,15 +76,15 @@ def test_compute_database_broken_api(monkeypatch, place_row, temp_db_conn): requested_url.append(url) return '