def call_nominatim(*args):
return nominatim.cli.nominatim(module_dir='build/module',
osm2pgsql_path='build/osm2pgsql/osm2pgsql',
- phplib_dir='lib',
+ phplib_dir='lib-php',
data_dir='.',
phpcgi_path='/usr/bin/php-cgi',
+ sqllib_dir='lib-sql',
+ config_dir='settings',
cli_args=args)
class MockParamCapture:
assert mock_run_legacy.called == 1
+@pytest.mark.parametrize("func, params", [('analyse_indexing', ('--analyse-indexing', ))])
+def test_admin_command_tool(temp_db, monkeypatch, func, params):
+ mock = MockParamCapture()
+ monkeypatch.setattr(nominatim.tools.admin, func, mock)
+
+ assert 0 == call_nominatim('admin', *params)
+ assert mock.called == 1
@pytest.mark.parametrize("name,oid", [('file', 'foo.osm'), ('diff', 'foo.osc'),
('node', 12), ('way', 8), ('relation', 32)])