Spaces:
Sleeping
Sleeping
Cyril Dupland
feat: implement brand and category slug normalization, update import mappings, and enhance article import processing
1cc158b | import pytest | |
| from app.domain.brand_normalization import normalize_brand_slug | |
| def test_normalize_brand_slug_replaces_spaces_and_punctuation() -> None: | |
| assert normalize_brand_slug(" Acme Corp ") == "acme-corp" | |
| assert normalize_brand_slug("Foo.Bar,Baz") == "foo-bar-baz" | |
| assert normalize_brand_slug("already-slug") == "already-slug" | |
| assert normalize_brand_slug("a -- b") == "a-b" | |
| def test_normalize_brand_slug_empty_to_none() -> None: | |
| assert normalize_brand_slug("") is None | |
| assert normalize_brand_slug(" ") is None | |
| assert normalize_brand_slug("...") is None | |
| assert normalize_brand_slug(None) is None | |