]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/test_cli.py
need test database for analysing cli test
[nominatim.git] / test / python / test_cli.py
index 9b39f580adb0919a982c416e2f29edd7f7b9fdaf..a8efd35670e63e0cc2744a2da097bd7db13f55f3 100644 (file)
@@ -23,9 +23,11 @@ from nominatim.db import status
 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:
@@ -85,6 +87,13 @@ def test_admin_command_legacy(monkeypatch, params):
 
     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)])