reorganization of folder/file for the special phrases importer

This commit is contained in:
AntoJvlt 2021-04-21 17:11:57 +02:00
parent 6812f397af
commit 1b68152fb2
4 changed files with 5 additions and 4 deletions

View 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()

View 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

View 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'