Files
FabledCurator/tests/test_slug.py
T
bvandeusen 4cb319b393 feat(fc2a): add slug and paths utilities
slugify() produces ASCII-only lowercase slugs from arbitrary text (used for
artist slugs and tag slugs). paths.derive_subdir/derive_top_level_artist
extract the destination layout and folder→artist convention from an import
source path. hash_suffixed_name builds IR-style 'stem__hash10.ext' filenames.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 12:04:05 -04:00

26 lines
517 B
Python

from backend.app.utils.slug import slugify
def test_slugify_basic():
assert slugify("Bob Ross") == "bob-ross"
def test_slugify_punctuation():
assert slugify("hello, world!") == "hello-world"
def test_slugify_unicode():
assert slugify("naïve café") == "naive-cafe"
def test_slugify_empty():
assert slugify("") == "untitled"
def test_slugify_only_punctuation():
assert slugify("!!!") == "untitled"
def test_slugify_leading_trailing_spaces():
assert slugify(" Alice ") == "alice"