2023-12-21 13:04:52 -08:00
|
|
|
"""Tests for filename parsing."""
|
|
|
|
from pprint import pprint
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from deepdiff.diff import DeepDiff
|
|
|
|
|
2024-02-20 00:21:54 -08:00
|
|
|
from comicfn2dict import ComicFilenameParser
|
2024-02-21 18:08:50 -08:00
|
|
|
from tests.comic_filenames import PARSE_FNS
|
2023-12-21 13:04:52 -08:00
|
|
|
|
|
|
|
|
2024-02-21 18:08:50 -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
|
2024-02-20 00:21:54 -08:00
|
|
|
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
|