codex-python / fixtures /pattern_lab /tests /test_baskets.py
tailot's picture
Upload folder using huggingface_hub
db2c7db verified
Raw History Blame Contribute Delete
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