X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5bf55a69a5f9ede8b4e673732f1150a81ca2de86..0af8dac3d35a94afe0b6ad775f3226d8d147501d:/test/python/api/test_api_status.py diff --git a/test/python/api/test_api_status.py b/test/python/api/test_api_status.py index 2acde2ec..9341b527 100644 --- a/test/python/api/test_api_status.py +++ b/test/python/api/test_api_status.py @@ -1,18 +1,18 @@ -# SPDX-License-Identifier: GPL-2.0-only +# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # -# Copyright (C) 2023 by the Nominatim developer community. +# Copyright (C) 2024 by the Nominatim developer community. # For a full list of authors see the git log. """ Tests for the status API call. """ -from pathlib import Path import datetime as dt import pytest -from nominatim.version import NOMINATIM_VERSION, NominatimVersion -import nominatim.api as napi +from nominatim_db.version import NominatimVersion +from nominatim_api.version import NOMINATIM_API_VERSION +import nominatim_api as napi def test_status_no_extra_info(apiobj, frontend): api = frontend(apiobj) @@ -20,7 +20,7 @@ def test_status_no_extra_info(apiobj, frontend): assert result.status == 0 assert result.message == 'OK' - assert result.software_version == NOMINATIM_VERSION + assert result.software_version == NOMINATIM_API_VERSION assert result.database_version is None assert result.data_updated is None @@ -37,20 +37,20 @@ def test_status_full(apiobj, frontend): assert result.status == 0 assert result.message == 'OK' - assert result.software_version == NOMINATIM_VERSION - assert result.database_version == NominatimVersion(99, 5, 4, 2) + assert result.software_version == NOMINATIM_API_VERSION + assert result.database_version == '99.5.4-2' assert result.data_updated == import_date def test_status_database_not_found(monkeypatch): monkeypatch.setenv('NOMINATIM_DATABASE_DSN', 'dbname=rgjdfkgjedkrgdfkngdfkg') - api = napi.NominatimAPI(Path('/invalid'), {}) + api = napi.NominatimAPI() result = api.status() assert result.status == 700 assert result.message == 'Database connection failed' - assert result.software_version == NOMINATIM_VERSION + assert result.software_version == NOMINATIM_API_VERSION assert result.database_version is None assert result.data_updated is None