# Path: packtools/sps/models/packages.py
# class Package:
#     def __init__(self, source, name):
#     def assets(self):
#     def name(self):
#     def file_path(self, file_path):
#     def add_asset(self, basename, file_path):
#     def get_asset(self, basename):
#     def add_rendition(self, lang, file_path):
#     def get_rendition(self, lang):
#     def source(self):
#     def xml(self):
#     def xml(self, value):
#     def renditions(self):
#     def xml_content(self):
# def select_filenames_by_prefix(prefix, files):
# def match_file_by_prefix(prefix, file_path):
# def explore_source(source):
# def _explore_folder(folder):
# def _explore_zipfile(zip_path):
# def _group_files_by_xml_filename(source, xmls, files):
# def _eval_file(prefix, file_path):


from unittest import TestCase
from packtools.sps.models import packages



class Test_get_component(TestCase):

    def test__eval_file_as_pdf(self):
        expected = {
            "component_id": "abcd-suppl01.pdf",
            "component_name": "abcd-suppl01",
            "file_path": "abcd-suppl01.pdf",
            "ftype": "pdf",
        }

# Path: packtools/sps/models/packages.py
# class Package:
#     def __init__(self, source, name):
#     def assets(self):
#     def name(self):
#     def file_path(self, file_path):
#     def add_asset(self, basename, file_path):
#     def get_asset(self, basename):
#     def add_rendition(self, lang, file_path):
#     def get_rendition(self, lang):
#     def source(self):
#     def xml(self):
#     def xml(self, value):
#     def renditions(self):
#     def xml_content(self):
# def select_filenames_by_prefix(prefix, files):
# def match_file_by_prefix(prefix, file_path):
# def explore_source(source):
# def _explore_folder(folder):
# def _explore_zipfile(zip_path):
# def _group_files_by_xml_filename(source, xmls, files):
# def _eval_file(prefix, file_path):


# Path: tests/sps/test_packages.py
from unittest import TestCase
from packtools.sps.models import packages




class Test_get_component(TestCase):

    def test__eval_file_as_pdf(self):
        expected = {
            "component_id": "abcd-suppl01.pdf",
            "component_name": "abcd-suppl01",
            "file_path": "abcd-suppl01.pdf",
            "ftype": "pdf",
        }

        result = packages._eval_file(