comicfn2dict/tests/test_comicfn2dict.py

23 lines
553 B
Python
Raw Permalink Normal View History

2023-12-21 13:04:52 -08:00
"""Tests for filename parsing."""
2023-12-21 13:04:52 -08:00
from pprint import pprint
import pytest
from deepdiff.diff import DeepDiff
from comicfn2dict import ComicFilenameParser
from tests.comic_filenames import PARSE_FNS
2023-12-21 13:04:52 -08:00
@pytest.mark.parametrize("item", PARSE_FNS.items())
2023-12-21 13:04:52 -08:00
def test_parse_filename(item):
"""Test filename parsing."""
fn, defined_fields = item
md = ComicFilenameParser(fn, verbose=1).parse()
2023-12-21 13:04:52 -08:00
diff = DeepDiff(defined_fields, md, ignore_order=True)
print(fn)
pprint(defined_fields)
pprint(md)
pprint(diff)
assert not diff