Files
lab4/tests/test_text_tools.py
lilrax 4544efe463
Some checks failed
CI / Lint / Ruff (push) Has been cancelled
CI / Test / Pytest coverage (push) Has been cancelled
CI / Build / Poetry package (push) Has been cancelled
Add CI pipeline for variant 5
2026-05-18 00:07:59 +03:00

15 lines
533 B
Python

from ci_lab.text_tools import normalize_text, unique_words, word_count
def test_normalize_text_removes_extra_spaces_and_lowers_case() -> None:
assert normalize_text(" Hello WORLD ") == "hello world"
def test_word_count_counts_words() -> None:
assert word_count("Python CI with GitHub Actions") == 5
def test_word_count_returns_zero_for_empty_text() -> None:
assert word_count(" ") == 0
def test_unique_words_returns_only_unique_values() -> None:
assert unique_words("Python python CI") == {"python", "ci"}