File size: 386 Bytes
db2c7db | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | """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
|