28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
"""Characterize photo_analyzer discovery + path policy (donor: discover_photos)."""
|
|
import photo_analyzer as pa
|
|
|
|
|
|
def test_discover_excludes_ignore_and_thumbs(library):
|
|
found = pa.discover_photos(library)
|
|
names = [p.name for p in found]
|
|
assert "secret.jpg" not in names, "_IGNORE/ content must never be discovered"
|
|
assert "thumb.jpg" not in names, ".@__thumb/ content must never be discovered"
|
|
assert "notes.txt" not in names
|
|
|
|
|
|
def test_discover_finds_supported_including_uppercase(library):
|
|
names = sorted(p.name for p in pa.discover_photos(library))
|
|
assert names == ["fx-blocks-01.jpg", "fx-blocks-02.PNG",
|
|
"fx-blocks-02.jpg", "fx-blocks-03.jpg"]
|
|
|
|
|
|
def test_discover_sorted_and_deduplicated(library):
|
|
found = pa.discover_photos(library)
|
|
assert found == sorted(set(found))
|
|
|
|
|
|
def test_supported_extensions_contract():
|
|
# Donor contract: these exact extensions (nsfwtag EXTS differs — no .tiff/.tif).
|
|
assert pa.SUPPORTED_EXTENSIONS == {
|
|
".jpg", ".jpeg", ".png", ".webp", ".heic", ".heif", ".tiff", ".tif"}
|