diff --git a/python/pymetkit/tests/test_expand.py b/python/pymetkit/tests/test_expand.py index 40bdb58a3..9ac3b26e5 100644 --- a/python/pymetkit/tests/test_expand.py +++ b/python/pymetkit/tests/test_expand.py @@ -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") == [ @@ -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 # ---------------------------------------------------------------------------