chore: move dependencies, add more tests

This commit is contained in:
2025-12-05 11:21:41 +01:00
parent 8455322af4
commit 30e4cded8f
10 changed files with 608 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
from .schemas.api_types import (
ALMASchema,
DNBSchema,
HBZSchema,
HebisSchema,
@@ -89,5 +90,3 @@ class HBZ(_Api):
self.prefix = HBZSchema.ARGSCHEMA.value
self.library_identifier = HBZSchema.LIBRARY_NAME_LOCATION_FIELD.value
super().__init__(self.site, self.url, self.prefix, self.library_identifier)

View File

@@ -327,3 +327,7 @@ class Catalogue:
if link is None:
return None
return link.library_location
def check_book_exists(self, searchterm: str) -> bool:
links = self.get_book_links(searchterm)
return len(links) > 0

View File

@@ -0,0 +1 @@
"""Schemas for the provided APIs."""

View File

@@ -0,0 +1,10 @@
class BibAPIError(Exception):
"""Base class for all BibAPI errors."""
class CatalogueError(BibAPIError):
"""Raised when there is an error with the library catalogue API."""
class NetworkError(BibAPIError):
"""Raised when there is a network-related error."""

View File

@@ -1,5 +1,4 @@
from dataclasses import dataclass, field
from typing import list
# --- MARC XML structures ---