Download benchmark/python/py-relevant-naturaldate-timezone/initial.patch from RedinGhost/beforedone-paper: direct link, hf CLI and curl.
- Browser
- Download file 954 Bytes
-
https://huggingface.co/datasets/RedinGhost/beforedone-paper/resolve/main/benchmark/python/py-relevant-naturaldate-timezone/initial.patch
- Command line
-
hf download hf://datasets/RedinGhost/beforedone-paper/benchmark/python/py-relevant-naturaldate-timezone/initial.patch
-
curl -L -o initial.patch https://huggingface.co/datasets/RedinGhost/beforedone-paper/resolve/main/benchmark/python/py-relevant-naturaldate-timezone/initial.patch
954 Bytes
| diff --git a/tests/test_time.py b/tests/test_time.py | |
| index 7699770..bd89145 100644 | |
| --- a/tests/test_time.py | |
| +++ b/tests/test_time.py | |
| def test_naturaldate_tz_aware() -> None: | |
| assert humanize.naturaldate(future.astimezone(pdt)) == "today" | |
| +def test_naturaldate_accepts_an_explicit_reference_day() -> None: | |
| + reference = dt.date(2026, 1, 10) | |
| + assert humanize.naturalday(dt.date(2026, 1, 11), when=reference) == "tomorrow" | |
| + assert humanize.naturaldate(dt.date(2026, 1, 9), when=reference) == "yesterday" | |
| + assert humanize.naturaldate(dt.date(2025, 7, 1), when=reference) == "Jul 01 2025" | |
| + | |
| + plus_fourteen = dt.timezone(dt.timedelta(hours=14)) | |
| + value = dt.datetime(2026, 1, 1, 0, 30, tzinfo=plus_fourteen) | |
| + instant = dt.datetime(2025, 12, 31, 12, 0, tzinfo=dt.timezone.utc) | |
| + assert humanize.naturaldate(value, when=instant) == "today" | |
| + | |
| + | |
| @pytest.mark.parametrize( | |
| "seconds, expected", | |
| [ | |