Initial commit

This commit is contained in:
hiperman
2025-12-04 00:33:37 -05:00
commit 7ca0a21283
798 changed files with 190424 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import pytest
from pathlib import Path
from datetime import date
from chitai.services.metadata_extractor import EpubExtractor
@pytest.mark.asyncio()
class TestEpubExtractor:
async def test_extraction_by_path(self):
path = Path("tests/data_files/Moby Dick; Or, The Whale - Herman Melville.epub")
metadata = await EpubExtractor.extract_metadata(path)
assert metadata["title"] == "Moby Dick; Or, The Whale"
assert metadata["authors"] == ["Herman Melville"]
assert metadata["published_date"] == date(year=2001, month=7, day=1)