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