1 # SPDX-License-Identifier: GPL-3.0-or-later
3 # This file is part of Nominatim. (https://nominatim.org)
5 # Copyright (C) 2025 by the Nominatim developer community.
6 # For a full list of authors see the git log.
8 Tests for warm-up CLI function.
12 import nominatim_db.cli
15 @pytest.fixture(autouse=True)
16 def setup_database_with_context(apiobj, table_factory):
18 definition='word_id INT, word_token TEXT, type TEXT, word TEXT, info JSONB',
19 content=[(55, 'test', 'W', 'test', None),
20 (2, 'test', 'w', 'test', None)])
22 apiobj.add_data('properties',
23 [{'property': 'tokenizer', 'value': 'icu'},
24 {'property': 'tokenizer_import_normalisation', 'value': ':: lower();'},
25 {'property': 'tokenizer_import_transliteration',
26 'value': "'1' > '/1/'; 'ä' > 'ä '"}
30 @pytest.mark.parametrize('args', [['--search-only'], ['--reverse-only']])
31 def test_warm_all(tmp_path, args):
32 assert 0 == nominatim_db.cli.nominatim(cli_args=['admin', '--project-dir', str(tmp_path),