Download fixtures/pattern_lab/tests/test_baskets.py from tailot/codex-python: direct link, hf CLI and curl.
- Browser
- Download file 386 Bytes
-
https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_baskets.py
- Command line
-
hf download hf://datasets/tailot/codex-python/fixtures/pattern_lab/tests/test_baskets.py
-
curl -L -o test_baskets.py https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_baskets.py
386 Bytes
| """Tests for the two emptiness shapes in src.baskets.""" | |
| from src.baskets import describe, first_or_none | |
| def test_describe_reports_whether_the_basket_holds_anything() -> None: | |
| assert describe([]) == "empty" | |
| assert describe([1, 2]) == "full" | |
| def test_first_or_none_gives_the_head_or_nothing() -> None: | |
| assert first_or_none([7]) == 7 | |
| assert first_or_none([]) is None | |