X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/faeee7528f710dc98bf14a08e592137d3e6d37f2..9ec26c60ff1c9b5b259ecb7ef16ad0bacbc3174b:/test/python/cli/test_cmd_admin.py?ds=sidebyside diff --git a/test/python/cli/test_cmd_admin.py b/test/python/cli/test_cmd_admin.py index 75ae3cd2..0fe6e327 100644 --- a/test/python/cli/test_cmd_admin.py +++ b/test/python/cli/test_cmd_admin.py @@ -33,6 +33,18 @@ 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', '--age', '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') + + with pytest.raises(SystemExit): + cli_call('admin', '--clean-deleted') + class TestCliAdminWithDb: @pytest.fixture(autouse=True)