# Path: demetsiiify/mets.py
# NAMESPACES = {
#     'mets': 'http://www.loc.gov/METS/',
#     'mods': 'http://www.loc.gov/mods/v3',
#     'dv': 'http://dfg-viewer.de/',
#     'xlink': 'http://www.w3.org/1999/xlink'}
# class ImageInfo:
# class PhysicalItem:
# class TocEntry:
# class MetsParseError(Exception):
# class MetsDocument:
#     def max_dimensions(self):
#     def min_dimensions(self):
#     def __init__(self, message: str, debug_info: dict = None) -> None:
#     def __init__(self, mets_tree: etree.ElementTree, url: str = None,
#                  primary_id: str = None) -> None:
#     def _xpath(self, xpath: str,
#                elem: etree.Element = None) -> List[etree.Element]:
#     def _find(self, path: str, elem: etree.Element = None) -> etree.Element:
#     def _findall(self, path: str,
#                  elem: etree.Element = None) -> List[etree.Element]:
#     def _findtext(self, path: str, elem: etree.Element = None) -> str:
#     def _parse_title(self, title_elem: etree.Element) -> str:
#     def _parse_name(self, name_elem: etree.Element) -> str:
#     def _read_persons(self) -> Mapping[str, List[str]]:
#     def _read_origin(self) -> Mapping[str, str]:
#     def _get_unique_identifier(self) -> str:
#     def _read_titles(self) -> List[str]:
#     def _read_metadata(self) -> dict:
#     def _read_files(self) -> Dict[str, ImageInfo]:
#     def _read_physical_items(self) -> Dict[str, PhysicalItem]:
#     def _parse_tocentry(self, toc_elem: etree.Element,
#                         lmap: Mapping[str, List[str]]) -> TocEntry:
#     def _read_toc_entries(self) -> List[TocEntry]:
#     def _get_image_specs(self, file_elem: etree.Element) -> ImageInfo:
# def get_basic_info(mets_url):


from lxml import etree
from demetsiiify import mets



def test_basic_mets(shared_datadir):
    mets_tree = etree.parse(
        str(shared_datadir / 'urn:nbn:de:gbv:23-drucke_li-1876-12.xml'))
    mets_doc = mets.MetsDocument(mets_tree)
    assert len(mets_doc.files) == 3616
    assert all(

# Path: demetsiiify/mets.py
# NAMESPACES = {
#     'mets': 'http://www.loc.gov/METS/',
#     'mods': 'http://www.loc.gov/mods/v3',
#     'dv': 'http://dfg-viewer.de/',
#     'xlink': 'http://www.w3.org/1999/xlink'}
# class ImageInfo:
# class PhysicalItem:
# class TocEntry:
# class MetsParseError(Exception):
# class MetsDocument:
#     def max_dimensions(self):
#     def min_dimensions(self):
#     def __init__(self, message: str, debug_info: dict = None) -> None:
#     def __init__(self, mets_tree: etree.ElementTree, url: str = None,
#                  primary_id: str = None) -> None:
#     def _xpath(self, xpath: str,
#                elem: etree.Element = None) -> List[etree.Element]:
#     def _find(self, path: str, elem: etree.Element = None) -> etree.Element:
#     def _findall(self, path: str,
#                  elem: etree.Element = None) -> List[etree.Element]:
#     def _findtext(self, path: str, elem: etree.Element = None) -> str:
#     def _parse_title(self, title_elem: etree.Element) -> str:
#     def _parse_name(self, name_elem: etree.Element) -> str:
#     def _read_persons(self) -> Mapping[str, List[str]]:
#     def _read_origin(self) -> Mapping[str, str]:
#     def _get_unique_identifier(self) -> str:
#     def _read_titles(self) -> List[str]:
#     def _read_metadata(self) -> dict:
#     def _read_files(self) -> Dict[str, ImageInfo]:
#     def _read_physical_items(self) -> Dict[str, PhysicalItem]:
#     def _parse_tocentry(self, toc_elem: etree.Element,
#                         lmap: Mapping[str, List[str]]) -> TocEntry:
#     def _read_toc_entries(self) -> List[TocEntry]:
#     def _get_image_specs(self, file_elem: etree.Element) -> ImageInfo:
# def get_basic_info(mets_url):


# Path: tests/test_mets.py
from lxml import etree
from demetsiiify import mets




def test_basic_mets(shared_datadir):
    mets_tree = etree.parse(
        str(shared_datadir / 'urn:nbn:de:gbv:23-drucke_li-1876-12.xml'))
    mets_doc = mets.MetsDocument(mets_tree)
    assert len(mets_doc.files) == 3616
    assert all(

        f.id is not None and f.url is not None and f.mimetype == 'image/jpeg'