38e20f2c30
Correctness: review vetoes persist via a dedupe_veto column (resolve re-runs no longer overturn humans); diff emits second copies whose confident version matches no owned copy (spec: pairs own only on both ids) and fetches the live collection with refresh; resolve pairs titles.json entries to rows by title so a reshoot photo updates provenance instead of duplicating rows; version lookups survive empty /thing results; publisher tie-break now honors the mixed base/expansion veto and refuses multi-candidate picks; empty-normalized (non-Latin) titles never count as exact. Upload: LoginError aborts a run instead of logging N bogus failures (and 3 identical consecutive failures abort as systemic); Cloudflare interstitials are detected; added-without-version gets its own logged status that verify understands; same-game updates run one per pass so the name-targeted row edit can't overwrite a fresh version; absent diff outputs fail loudly; pagination clicks are paced. Web review: a lock serializes freshen/decide (threadpool race dropped decisions); failed saves roll memory back and always alert the browser (non-JSON 500s included); session warnings reach the page instead of a StringIO; state-load failures and dead servers show banners instead of a blank page; duplicate (title, photos) rows are addressable by ordinal. Consistency: shared CONFIDENT_VERSION_STATUSES, client_for(), Config paths for every artifact, one review-port constant, named matching thresholds, strict collection-id parsing, error-doc responses never cached, unknown config keys warn, extract reports dropped vision entries, fixture generators share escaping + marker text. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
30 lines
852 B
Python
30 lines
852 B
Python
"""Title normalization must be symmetric and aggressive (spec)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from bggpipe.normalize import normalize_title
|
|
|
|
|
|
def test_casefold_and_punctuation():
|
|
assert normalize_title("Wingspan: European Expansion") == (
|
|
"wingspan european expansion"
|
|
)
|
|
|
|
|
|
def test_accents_stripped():
|
|
assert normalize_title("Café International") == "cafe international"
|
|
|
|
|
|
def test_ampersand_becomes_and():
|
|
assert normalize_title("Axis & Allies") == "axis and allies"
|
|
assert normalize_title("Axis and Allies") == "axis and allies"
|
|
|
|
|
|
def test_articles_dropped():
|
|
assert normalize_title("The Castles of Burgundy") == "castles of burgundy"
|
|
assert normalize_title("A Feast for Odin") == "feast for odin"
|
|
|
|
|
|
def test_whitespace_collapsed():
|
|
assert normalize_title(" Ticket to Ride ") == "ticket to ride"
|