US03-01: Aggregate Album Evidence (#61)

This commit was merged in pull request #61.
This commit is contained in:
2026-08-15 13:10:31 +02:00
parent b9bcb47c68
commit de4a9403cf
6 changed files with 635 additions and 3 deletions

View File

@@ -22,6 +22,19 @@ def test_webapp_album_of_mirrors_album_label():
assert query.album_of(p, lib) == pa.album_label(Path(p), lib), p
def test_albums_service_album_label_matches_donor():
# Parity: the extracted single implementation (US03-01) matches the donor rule
# (donor_ledger.yaml: pa-album-label, wa-album-of). The service takes a tuple of
# library roots; the donor takes one Path.
from photo_pipeline.services.albums import album_label
lib = Path("/lib")
for p in ("/lib/Urlaub/Rom/a.jpg", "/lib/a.jpg", "/other/x/a.jpg", "/lib/x/y/a.jpg"):
assert album_label(p, (lib,)) == pa.album_label(Path(p), lib), p
# No configured roots → bare parent name, like the donor with library=None.
assert album_label("/lib/x/a.jpg", ()) == pa.album_label(Path("/lib/x/a.jpg"), None)
def test_fit_label_left_truncates():
assert pa.fit_label("short", 10) == "short"
assert pa.fit_label("Urlaub/Somewhere/Rom", 8) == "…ere/Rom"