X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d7a3039c2a4bd26d05f08ee3140b8dfaecd68f02..8e5a19b39209f20f41b7bd10ff7dbcdb8a3dcb9c:/test/python/tokenizer/test_legacy.py?ds=sidebyside diff --git a/test/python/tokenizer/test_legacy.py b/test/python/tokenizer/test_legacy.py index d63ee8e1..bf208c92 100644 --- a/test/python/tokenizer/test_legacy.py +++ b/test/python/tokenizer/test_legacy.py @@ -1,8 +1,8 @@ -# 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) 2022 by the Nominatim developer community. +# Copyright (C) 2024 by the Nominatim developer community. # For a full list of authors see the git log. """ Test for legacy tokenizer. @@ -12,10 +12,10 @@ import re import pytest -from nominatim.data.place_info import PlaceInfo -from nominatim.tokenizer import legacy_tokenizer -from nominatim.db import properties -from nominatim.errors import UsageError +from nominatim_db.data.place_info import PlaceInfo +from nominatim_db.tokenizer import legacy_tokenizer +from nominatim_db.db import properties +from nominatim_db.errors import UsageError from mock_legacy_word_table import MockLegacyWordTable @@ -238,19 +238,19 @@ def test_check_database_bad_setup(test_config, tokenizer_factory, monkeypatch, assert tok.check_database(False) is not None -def test_update_statistics_reverse_only(word_table, tokenizer_factory): +def test_update_statistics_reverse_only(word_table, tokenizer_factory, test_config): tok = tokenizer_factory() - tok.update_statistics() + tok.update_statistics(test_config) -def test_update_statistics(word_table, table_factory, temp_db_cursor, tokenizer_factory): +def test_update_statistics(word_table, table_factory, temp_db_cursor, tokenizer_factory, test_config): word_table.add_full_word(1000, 'hello') table_factory('search_name', 'place_id BIGINT, name_vector INT[]', [(12, [1000])]) tok = tokenizer_factory() - tok.update_statistics() + tok.update_statistics(test_config) assert temp_db_cursor.scalar("""SELECT count(*) FROM word WHERE word_token like ' %' and