-def test_special_phrases_command(temp_db, mock_func_factory):
- func = mock_func_factory(nominatim.clicmd.special_phrases.SpecialPhrasesImporter, 'import_from_wiki')
+@pytest.mark.parametrize("no_replace", [(True), (False)])
+def test_special_phrases_wiki_command(temp_db, mock_func_factory, tokenizer_mock, no_replace):
+ func = mock_func_factory(nominatim.clicmd.special_phrases.SPImporter, 'import_phrases')
+
+ if no_replace:
+ call_nominatim('special-phrases', '--import-from-wiki', '--no-replace')
+ else:
+ call_nominatim('special-phrases', '--import-from-wiki')
+
+ assert func.called == 1
+
+@pytest.mark.parametrize("no_replace", [(True), (False)])
+def test_special_phrases_csv_command(temp_db, mock_func_factory, tokenizer_mock, no_replace):
+ func = mock_func_factory(nominatim.clicmd.special_phrases.SPImporter, 'import_phrases')
+ testdata = SRC_DIR / 'test' / 'testdb'
+ csv_path = str((testdata / 'full_en_phrases_test.csv').resolve())