From 33098a7ee0322c6a86dbb88b69b8b8d046294723 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Wed, 13 Sep 2023 11:44:15 -0300 Subject: [PATCH] Fix api tests. --- scripts.py | 3 ++- tests/api/admin/test_routes.py | 23 ----------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/scripts.py b/scripts.py index 435f185d2f..82a50e7c12 100644 --- a/scripts.py +++ b/scripts.py @@ -6,6 +6,7 @@ from datetime import timedelta from pathlib import Path from typing import Optional +from unittest.mock import MagicMock from sqlalchemy import inspect from sqlalchemy.engine import Connection @@ -193,7 +194,7 @@ def __init__(self, _db=None, cmd_args=None, manager=None, *args, **kwargs): super().__init__(_db, *args, **kwargs) self.parse_args(cmd_args) if not manager: - manager = CirculationManager(self._db) + manager = CirculationManager(self._db, MagicMock()) from api.app import app app.manager = manager diff --git a/tests/api/admin/test_routes.py b/tests/api/admin/test_routes.py index 465aec0e7f..6dae466615 100644 --- a/tests/api/admin/test_routes.py +++ b/tests/api/admin/test_routes.py @@ -680,29 +680,6 @@ def test_process_search_service_self_tests(self, fixture: AdminRouteFixture): fixture.assert_supported_methods(url, "GET", "POST") -class TestAdminStorageServices: - CONTROLLER_NAME = "admin_storage_services_controller" - - @pytest.fixture(scope="function") - def fixture(self, admin_route_fixture: AdminRouteFixture) -> AdminRouteFixture: - admin_route_fixture.set_controller_name(self.CONTROLLER_NAME) - return admin_route_fixture - - def test_process_services(self, fixture: AdminRouteFixture): - url = "/admin/storage_services" - fixture.assert_authenticated_request_calls( - url, fixture.controller.process_services # type: ignore - ) - fixture.assert_supported_methods(url, "GET", "POST") - - def test_process_delete(self, fixture: AdminRouteFixture): - url = "/admin/storage_service/" - fixture.assert_authenticated_request_calls( - url, fixture.controller.process_delete, "", http_method="DELETE" # type: ignore - ) - fixture.assert_supported_methods(url, "DELETE") - - class TestAdminCatalogServices: CONTROLLER_NAME = "admin_catalog_services_controller"