d58568cceb
uv project with typer/httpx/rapidfuzz, ruff and pytest wired into pyproject. Six stub subcommands matching the pipeline stages, config.toml plus BGG_USERNAME env override, accent/ampersand/article-safe title normalization with tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
26 lines
748 B
Python
26 lines
748 B
Python
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"
|