+@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("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
+