chore: move dependencies, add more tests
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
1
src/bibapi/schemas/__init__.py
Normal file
1
src/bibapi/schemas/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Schemas for the provided APIs."""
|
||||
10
src/bibapi/schemas/errors.py
Normal file
10
src/bibapi/schemas/errors.py
Normal 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."""
|
||||
@@ -1,5 +1,4 @@
|
||||
from dataclasses import dataclass, field
|
||||
from typing import list
|
||||
|
||||
|
||||
# --- MARC XML structures ---
|
||||
|
||||
Reference in New Issue
Block a user