Skip to main content

tests/test_text.py

1"""
2Tests for `chives.text`.
3"""
5import pytest
7from chives.text import smartify
10@pytest.mark.parametrize(
11 "text, expected",
12 [
13 ("Isn't it delightful -- she said", "Isn’t it delightful – she said"),
14 ("Are you ... sure?", "Are you … sure?"),
15 ("<h2>Isn't it delightful?</h2>", "<h2>Isn’t it delightful?</h2>"),
16 ("<li>Isn't it delightful?</li>", "<li>Isn’t it delightful?</li>"),
17 ("<p>&quot;It's nice&quot;, he said</p>", "<p>“It’s nice”, he said</p>"),
18 ],
20def test_smartify(text: str, expected: str) -> None:
21 """
22 Test smartify().
23 """
24 actual = smartify(text)
25 assert actual == expected