mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 02:47:59 +00:00
remove the language parameter in the SPWikiLoader
Languages must always be configured through config or environment. Also use monkeypatched environment in tests.
This commit is contained in:
@@ -23,11 +23,12 @@ def testfile_dir(src_dir):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def sp_importer(temp_db_conn, def_config):
|
||||
def sp_importer(temp_db_conn, def_config, monkeypatch):
|
||||
"""
|
||||
Return an instance of SPImporter.
|
||||
"""
|
||||
loader = SPWikiLoader(def_config, ['en'])
|
||||
monkeypatch.setenv('NOMINATIM_LANGUAGES', 'en')
|
||||
loader = SPWikiLoader(def_config)
|
||||
return SPImporter(def_config, temp_db_conn, loader)
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ def sp_wiki_loader(monkeypatch, def_config, xml_wiki_content):
|
||||
"""
|
||||
Return an instance of SPWikiLoader.
|
||||
"""
|
||||
loader = SPWikiLoader(def_config, ['en'])
|
||||
monkeypatch.setenv('NOMINATIM_LANGUAGES', 'en')
|
||||
loader = SPWikiLoader(def_config)
|
||||
monkeypatch.setattr('nominatim.tools.special_phrases.sp_wiki_loader.SPWikiLoader._get_wiki_content',
|
||||
lambda self, lang: xml_wiki_content)
|
||||
return loader
|
||||
|
||||
Reference in New Issue
Block a user