Download fixtures/pattern_lab/tests/test_tokens.py from tailot/codex-python: direct link, hf CLI and curl.
- Browser
- Download file 433 Bytes
-
https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_tokens.py
- Command line
-
hf download hf://datasets/tailot/codex-python/fixtures/pattern_lab/tests/test_tokens.py
-
curl -L -o test_tokens.py https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_tokens.py
433 Bytes
| """Tests for src.tokens.""" | |
| from src.tokens import count_lines, count_words, summarize | |
| def test_count_words_counts_words_by_default() -> None: | |
| assert count_words("one two three") == 3 | |
| def test_count_words_counts_lines_when_asked() -> None: | |
| assert count_words("one\ntwo", unit="line") == 2 | |
| def test_summarize_follows_the_unit() -> None: | |
| assert summarize("a b", unit="word") == 2 | |
| assert count_lines("a\nb") == 2 | |