X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/195f9f5ef3f79ea4c77ee1226f8aa7e7e8f4a73f..0cbf98c0204f0e90e1f6d22110eb80ee87dae0e0:/test/python/test_cli.py diff --git a/test/python/test_cli.py b/test/python/test_cli.py index 983b792b..9b39f580 100644 --- a/test/python/test_cli.py +++ b/test/python/test_cli.py @@ -13,6 +13,7 @@ import time import nominatim.cli import nominatim.clicmd.api import nominatim.clicmd.refresh +import nominatim.clicmd.admin import nominatim.indexer.indexer import nominatim.tools.refresh import nominatim.tools.replication @@ -63,8 +64,6 @@ def test_cli_help(capsys): (('special-phrases',), 'specialphrases'), (('add-data', '--tiger-data', 'tiger'), 'setup'), (('add-data', '--file', 'foo.osm'), 'update'), - (('check-database',), 'check_import_finished'), - (('warm',), 'warm'), (('export',), 'export') ]) def test_legacy_commands_simple(mock_run_legacy, command, script): @@ -74,6 +73,19 @@ def test_legacy_commands_simple(mock_run_legacy, command, script): assert mock_run_legacy.last_args[0] == script + '.php' +@pytest.mark.parametrize("params", [('--warm', ), + ('--warm', '--reverse-only'), + ('--warm', '--search-only'), + ('--check-database', )]) +def test_admin_command_legacy(monkeypatch, params): + mock_run_legacy = MockParamCapture() + monkeypatch.setattr(nominatim.clicmd.admin, 'run_legacy_script', mock_run_legacy) + + assert 0 == call_nominatim('admin', *params) + + assert mock_run_legacy.called == 1 + + @pytest.mark.parametrize("name,oid", [('file', 'foo.osm'), ('diff', 'foo.osc'), ('node', 12), ('way', 8), ('relation', 32)]) def test_add_data_command(mock_run_legacy, name, oid):