]> git.openstreetmap.org Git - nominatim.git/commitdiff
reorganization of folder/file for the special phrases importer
authorAntoJvlt <antonin.jolivat@gmail.com>
Wed, 21 Apr 2021 15:11:57 +0000 (17:11 +0200)
committerAntoJvlt <antonin.jolivat@gmail.com>
Sun, 25 Apr 2021 15:57:42 +0000 (17:57 +0200)
nominatim/clicmd/special_phrases.py
nominatim/tools/__init__.py
nominatim/tools/special_phrases/special_phrases_importer.py [moved from nominatim/tools/special_phrases.py with 100% similarity]
test/python/test_tools_import_special_phrases.py

index 99e825925ad63443b305543624cde60572740fee..1eb25bdc156ea8dc9bc0ce53441a1d598620de0c 100644 (file)
@@ -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()
index cab6fb8b89ce541f1054ad7887cd5aafcdd0d5c1..cc5d3e9ba2890ac52993bac07cf57472e128a5d3 100644 (file)
@@ -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
index 4890e0b22be519e4c53a94880eeacec7e4075d3e..cb82f6b78c3d6ad53333673773dd9294ce4c2493 100644 (file)
@@ -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'