<reponame>imagination-ai/kerem-side-projects-monorepo
from style.utils.utils import sanitize_author_name


def test_sanitize_author_name():
    cases = [
        "<NAME>, 1743-1826",
        "<NAME>, 1814-1900 [Translator]",
        "Townsend, <NAME>, 1814-1900 [Translator]",
    ]

    expects = ["thomas_jefferson", "george_fyler", "george_fyler_townsend"]

    for case, expect in zip(cases, expects):
        assert sanitize_author_name(case) == expect
