import pytest from app.domain.brand_normalization import normalize_brand_slug @pytest.mark.unit 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" @pytest.mark.unit 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