X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/14a78f55cd7ba70fd4334f2010ecd0b1b991a600..a79c1bda9b77635e31f228e031ecbb6465f8dff4:/test/python/tokenizer/test_legacy.py diff --git a/test/python/tokenizer/test_legacy.py b/test/python/tokenizer/test_legacy.py index 45cd94aa..0e46f1dc 100644 --- a/test/python/tokenizer/test_legacy.py +++ b/test/python/tokenizer/test_legacy.py @@ -1,3 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# This file is part of Nominatim. (https://nominatim.org) +# +# Copyright (C) 2022 by the Nominatim developer community. +# For a full list of authors see the git log. """ Test for legacy tokenizer. """ @@ -179,7 +185,7 @@ def test_finalize_import(tokenizer_factory, temp_db_conn, func_file = test_config.lib_dir.sql / 'tokenizer' / 'legacy_tokenizer_indices.sql' func_file.write_text("""CREATE FUNCTION test() RETURNS TEXT - AS $$ SELECT 'b' $$ LANGUAGE SQL""") + AS $$ SELECT 'b'::text $$ LANGUAGE SQL""") tok = tokenizer_factory() tok.init_new_db(test_config) @@ -227,7 +233,7 @@ def test_check_database_bad_setup(test_config, tokenizer_factory, monkeypatch, # Inject a bad transliteration. temp_db_cursor.execute("""CREATE OR REPLACE FUNCTION make_standard_name(name TEXT) - RETURNS TEXT AS $$ SELECT 'garbage'; $$ LANGUAGE SQL""") + RETURNS TEXT AS $$ SELECT 'garbage'::text; $$ LANGUAGE SQL""") assert tok.check_database(False) is not None @@ -251,6 +257,13 @@ def test_update_statistics(word_table, table_factory, temp_db_cursor, tokenizer_ search_name_count > 0""") > 0 +def test_update_word_tokens(tokenizer_factory): + tok = tokenizer_factory() + + # This is a noop and should just pass. + tok.update_word_tokens() + + def test_normalize(analyzer): assert analyzer.normalize('TEsT') == 'test'