Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tthijm committed Jun 12, 2024
1 parent 5e8844a commit 92796db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,11 @@ def test_is_inside_class():
)
def test_format_dt(dt: datetime.datetime, style: typing.Optional[utils.TimestampStyle], formatted: str):
assert utils.format_dt(dt, style=style) == formatted


def test__human_join() -> None:
assert utils._human_join([]) == ""
assert utils._human_join(["cat"]) == "cat"
assert utils._human_join(["cat", "dog"]) == "cat or dog"
assert utils._human_join(["cat", "dog", "fish"]) == "cat, dog or fish"
assert utils._human_join(["cat", "dog", "fish", "bird"], delimiter="; ", final="and") == "cat; dog; fish and bird"

0 comments on commit 92796db

Please sign in to comment.