Skip to content

Commit

Permalink
feat: move mandown.save_metadata into public namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoeggy committed Jan 11, 2024
1 parent 9d0e56e commit 300a982
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions mandown/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
process,
process_progress,
query,
save_metadata,
)
from .base import BaseChapter, BaseMetadata
from .comic import BaseComic
Expand Down
23 changes: 23 additions & 0 deletions tests/test_io_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from pathlib import Path

import mandown
from mandown import BaseChapter, BaseComic, BaseMetadata


def test_load_save(tmp_path: Path) -> None:
comic = BaseComic(
BaseMetadata(
title="Test Comic",
authors=["Test Author"],
url="",
genres=["Test", "Genres"],
description="Test Description",
cover_art="https://example.com/cover.jpg",
),
[
BaseChapter("Test Chapter", "https://example.com/chapter"),
],
)
mandown.save_metadata(comic, tmp_path)
loaded = mandown.load(tmp_path)
assert comic.asdict() == loaded.asdict()

0 comments on commit 300a982

Please sign in to comment.