X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/faeee7528f710dc98bf14a08e592137d3e6d37f2..5b02cd22b9d9bdf9d3cd32d9e4cfcb971a92c606:/test/python/cli/test_cmd_admin.py diff --git a/test/python/cli/test_cmd_admin.py b/test/python/cli/test_cmd_admin.py index 75ae3cd2..cc80c19a 100644 --- a/test/python/cli/test_cmd_admin.py +++ b/test/python/cli/test_cmd_admin.py @@ -8,7 +8,7 @@ Test for the command line interface wrapper admin subcommand. These tests just check that the various command line parameters route to the -correct functionionality. They use a lot of monkeypatching to avoid executing +correct functionality. They use a lot of monkeypatching to avoid executing the actual functions. """ import pytest @@ -33,6 +33,17 @@ def test_admin_migrate(cli_call, mock_func_factory): assert mock.called == 1 +def test_admin_clean_deleted_relations(cli_call, mock_func_factory): + mock = mock_func_factory(nominatim.tools.admin, 'clean_deleted_relations') + + assert cli_call('admin', '--clean-deleted', '1 month') == 0 + assert mock.called == 1 + +def test_admin_clean_deleted_relations_no_age(cli_call, mock_func_factory): + mock = mock_func_factory(nominatim.tools.admin, 'clean_deleted_relations') + + assert cli_call('admin', '--clean-deleted') == 1 + class TestCliAdminWithDb: @pytest.fixture(autouse=True)