diff --git a/nominatim/clicmd/special_phrases.py b/nominatim/clicmd/special_phrases.py index 99e82592..1eb25bdc 100644 --- a/nominatim/clicmd/special_phrases.py +++ b/nominatim/clicmd/special_phrases.py @@ -2,7 +2,7 @@ Implementation of the 'special-phrases' command. """ import logging -from nominatim.tools.special_phrases import SpecialPhrasesImporter +from nominatim.tools import SpecialPhrasesImporter from nominatim.db.connection import connect LOG = logging.getLogger() diff --git a/nominatim/tools/__init__.py b/nominatim/tools/__init__.py index cab6fb8b..cc5d3e9b 100644 --- a/nominatim/tools/__init__.py +++ b/nominatim/tools/__init__.py @@ -2,3 +2,5 @@ Module with functions for importing, updating Nominatim databases as well as general maintenance helpers. """ + +from nominatim.tools.special_phrases.special_phrases_importer import SpecialPhrasesImporter diff --git a/nominatim/tools/special_phrases.py b/nominatim/tools/special_phrases/special_phrases_importer.py similarity index 100% rename from nominatim/tools/special_phrases.py rename to nominatim/tools/special_phrases/special_phrases_importer.py diff --git a/test/python/test_tools_import_special_phrases.py b/test/python/test_tools_import_special_phrases.py index 4890e0b2..cb82f6b7 100644 --- a/test/python/test_tools_import_special_phrases.py +++ b/test/python/test_tools_import_special_phrases.py @@ -2,13 +2,12 @@ Tests for import special phrases methods of the class SpecialPhrasesImporter. """ -from mocks import MockParamCapture from nominatim.errors import UsageError from pathlib import Path import tempfile from shutil import copyfile import pytest -from nominatim.tools.special_phrases import SpecialPhrasesImporter +from nominatim.tools import SpecialPhrasesImporter TEST_BASE_DIR = Path(__file__) / '..' / '..' @@ -304,7 +303,7 @@ def test_import_from_wiki(monkeypatch, temp_db_conn, def_config, special_phrases CREATE TABLE place_classtype_amenity_animal_shelter(); CREATE TABLE place_classtype_wrongclass_wrongtype();""") - monkeypatch.setattr('nominatim.tools.special_phrases.SpecialPhrasesImporter._get_wiki_content', mock_get_wiki_content) + monkeypatch.setattr('nominatim.tools.SpecialPhrasesImporter._get_wiki_content', mock_get_wiki_content) special_phrases_importer.import_from_wiki(['en']) class_test = 'aerialway'