Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions python/pymetkit/tests/test_expand.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ def test_date_year_day_of_year():
assert expand_key("date", "2018-23") == ["20180123"]


def test_date_range_alternate_format():
# Check that expansion respects alternate date formats
assert expand_key("date", "2020-01-01/to/2020-01-03") == [
"20200101",
"20200102",
"20200103",
]


def test_date_range_crosses_leap_day():
# 2020 is a leap year, so 29 Feb is included.
assert expand_key("date", "20200228/to/20200302") == [
Expand All @@ -138,6 +147,15 @@ def test_month_name_climatology_passthrough(value):
assert expand_key("date", value) == [value]


def test_hdate_range():
# Check that expansion respects alternate date formats
assert expand_key("date", "20200101/to/20200103") == [
"20200101",
"20200102",
"20200103",
]


# ---------------------------------------------------------------------------
# Numeric / expver value normalisation
# ---------------------------------------------------------------------------
Expand Down
Loading