X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/639630d5fe91b38d39123f002ef77c70c3b1b520..cd08956c610f224096ae831a59eb0412faaaeaad:/test/python/api/query_processing/test_normalize.py diff --git a/test/python/api/query_processing/test_normalize.py b/test/python/api/query_processing/test_normalize.py index db8bbe0b..35f5fcd7 100644 --- a/test/python/api/query_processing/test_normalize.py +++ b/test/python/api/query_processing/test_normalize.py @@ -2,21 +2,18 @@ # # 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 normalizing search queries. """ -from pathlib import Path - -import pytest - from icu import Transliterator import nominatim_api.search.query as qmod from nominatim_api.query_preprocessing.config import QueryConfig from nominatim_api.query_preprocessing import normalize + def run_preprocessor_on(query, norm): normalizer = Transliterator.createFromRules("normalization", norm) proc = normalize.create(QueryConfig().set_normalizer(normalizer)) @@ -26,9 +23,9 @@ def run_preprocessor_on(query, norm): def test_normalize_simple(): norm = ':: lower();' - query = [qmod.Phrase(qmod.PhraseType.NONE, 'Hallo')] + query = [qmod.Phrase(qmod.PHRASE_ANY, 'Hallo')] out = run_preprocessor_on(query, norm) assert len(out) == 1 - assert out == [qmod.Phrase(qmod.PhraseType.NONE, 'hallo')] + assert out == [qmod.Phrase(qmod.PHRASE_ANY, 'hallo')]