X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/247065ff6f6f096c609729080b83896235aedfc8..4cc788f69e1191d2dd985aeac143597566529f24:/test/python/api/test_api_search.py diff --git a/test/python/api/test_api_search.py b/test/python/api/test_api_search.py index 25f63bb8..59a83aa9 100644 --- a/test/python/api/test_api_search.py +++ b/test/python/api/test_api_search.py @@ -2,7 +2,7 @@ # # This file is part of Nominatim. (https://nominatim.org) # -# Copyright (C) 2023 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 search API calls. @@ -10,17 +10,13 @@ Tests for search API calls. These tests make sure that all Python code is correct and executable. Functional tests can be found in the BDD test suite. """ -import json - import pytest -import sqlalchemy as sa - -import nominatim.api as napi -import nominatim.api.logging as loglib +import nominatim_api.logging as loglib API_OPTIONS = {'search'} + @pytest.fixture(autouse=True) def setup_icu_tokenizer(apiobj): """ Setup the properties needed for using the ICU tokenizer. @@ -28,8 +24,9 @@ def setup_icu_tokenizer(apiobj): apiobj.add_data('properties', [{'property': 'tokenizer', 'value': 'icu'}, {'property': 'tokenizer_import_normalisation', 'value': ':: lower();'}, - {'property': 'tokenizer_import_transliteration', 'value': "'1' > '/1/'; 'ä' > 'ä '"}, - ]) + {'property': 'tokenizer_import_transliteration', + 'value': "'1' > '/1/'; 'ä' > 'ä '"}, + ]) def test_search_no_content(apiobj, frontend): @@ -64,7 +61,7 @@ def test_search_with_debug(apiobj, frontend, logtype): api = frontend(apiobj, options=API_OPTIONS) loglib.set_log_output(logtype) - results = api.search('TEST') + api.search('TEST') assert loglib.get_and_disable()