forked from hans/Nominatim
remove all references to a module path
No longer used now that legacy tokenizer is gone.
This commit is contained in:
@@ -14,8 +14,7 @@ import nominatim_db.cli
|
||||
@pytest.fixture
|
||||
def run_export(tmp_path, capsys):
|
||||
def _exec(args):
|
||||
assert 0 == nominatim_db.cli.nominatim(module_dir='MODULE NOT AVAILABLE',
|
||||
osm2pgsql_path='OSM2PGSQL NOT AVAILABLE',
|
||||
assert 0 == nominatim_db.cli.nominatim(osm2pgsql_path='OSM2PGSQL NOT AVAILABLE',
|
||||
cli_args=['export', '--project-dir', str(tmp_path)]
|
||||
+ args)
|
||||
return capsys.readouterr().out.split('\r\n')
|
||||
|
||||
@@ -27,7 +27,6 @@ def setup_database_with_context(apiobj, table_factory):
|
||||
|
||||
@pytest.mark.parametrize('args', [['--search-only'], ['--reverse-only']])
|
||||
def test_warm_all(tmp_path, args):
|
||||
assert 0 == nominatim_db.cli.nominatim(module_dir='MODULE NOT AVAILABLE',
|
||||
osm2pgsql_path='OSM2PGSQL NOT AVAILABLE',
|
||||
assert 0 == nominatim_db.cli.nominatim(osm2pgsql_path='OSM2PGSQL NOT AVAILABLE',
|
||||
cli_args=['admin', '--project-dir', str(tmp_path),
|
||||
'--warm'] + args)
|
||||
|
||||
@@ -68,8 +68,7 @@ def cli_call():
|
||||
Returns a function that can be called with the desired CLI arguments.
|
||||
"""
|
||||
def _call_nominatim(*args):
|
||||
return nominatim_db.cli.nominatim(module_dir='MODULE NOT AVAILABLE',
|
||||
osm2pgsql_path='OSM2PGSQL NOT AVAILABLE',
|
||||
return nominatim_db.cli.nominatim(osm2pgsql_path='OSM2PGSQL NOT AVAILABLE',
|
||||
cli_args=args)
|
||||
|
||||
return _call_nominatim
|
||||
|
||||
@@ -140,8 +140,8 @@ def test_get_bool(make_config, monkeypatch, value, result):
|
||||
def test_get_bool_empty(make_config):
|
||||
config = make_config()
|
||||
|
||||
assert config.DATABASE_MODULE_PATH == ''
|
||||
assert not config.get_bool('DATABASE_MODULE_PATH')
|
||||
assert config.TOKENIZER_CONFIG == ''
|
||||
assert not config.get_bool('TOKENIZER_CONFIG')
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value,result", [('0', 0), ('1', 1),
|
||||
@@ -167,10 +167,10 @@ def test_get_int_bad_values(make_config, monkeypatch, value):
|
||||
def test_get_int_empty(make_config):
|
||||
config = make_config()
|
||||
|
||||
assert config.DATABASE_MODULE_PATH == ''
|
||||
assert config.TOKENIZER_CONFIG == ''
|
||||
|
||||
with pytest.raises(UsageError):
|
||||
config.get_int('DATABASE_MODULE_PATH')
|
||||
config.get_int('TOKENIZER_CONFIG')
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value,outlist", [('sd', ['sd']),
|
||||
@@ -193,8 +193,8 @@ def test_get_str_list_empty(make_config):
|
||||
def test_get_path_empty(make_config):
|
||||
config = make_config()
|
||||
|
||||
assert config.DATABASE_MODULE_PATH == ''
|
||||
assert not config.get_path('DATABASE_MODULE_PATH')
|
||||
assert config.TOKENIZER_CONFIG == ''
|
||||
assert not config.get_path('TOKENIZER_CONFIG')
|
||||
|
||||
|
||||
def test_get_path_absolute(make_config, monkeypatch):
|
||||
|
||||
@@ -109,7 +109,7 @@ def table_factory(temp_db_conn):
|
||||
@pytest.fixture
|
||||
def def_config():
|
||||
cfg = Configuration(None)
|
||||
cfg.set_libdirs(module='.', osm2pgsql='.')
|
||||
cfg.set_libdirs(osm2pgsql=None)
|
||||
return cfg
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ def project_env(tmp_path):
|
||||
projdir = tmp_path / 'project'
|
||||
projdir.mkdir()
|
||||
cfg = Configuration(projdir)
|
||||
cfg.set_libdirs(module='.', osm2pgsql='.')
|
||||
cfg.set_libdirs(osm2pgsql=None)
|
||||
return cfg
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ def osmline_table(temp_db_with_extensions, table_factory):
|
||||
def sql_preprocessor_cfg(tmp_path, table_factory, temp_db_with_extensions):
|
||||
table_factory('country_name', 'partition INT', ((0, ), (1, ), (2, )))
|
||||
cfg = Configuration(None)
|
||||
cfg.set_libdirs(module='.', osm2pgsql='.', sql=tmp_path)
|
||||
cfg.set_libdirs(osm2pgsql=None, sql=tmp_path)
|
||||
return cfg
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user