Skip to content

Commit

Permalink
Fix api tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Sep 13, 2023
1 parent 472e2b5 commit 33098a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
3 changes: 2 additions & 1 deletion scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 0 additions & 23 deletions tests/api/admin/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/<service_id>"
fixture.assert_authenticated_request_calls(
url, fixture.controller.process_delete, "<service_id>", http_method="DELETE" # type: ignore
)
fixture.assert_supported_methods(url, "DELETE")


class TestAdminCatalogServices:
CONTROLLER_NAME = "admin_catalog_services_controller"

Expand Down

0 comments on commit 33098a7

Please sign in to comment.