Skip to content

Commit 7170433

Browse files
committed
Fix typo in comment and add tests for Gregorian month max day
1 parent b5e9c7f commit 7170433

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

tests/test_converters/test_calendars/test_gregorian.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ def test_min_month(self):
1313
def test_max_month(self):
1414
assert GregorianDateConverter().max_month(2025) == 12
1515

16-
# todo: test max day
17-
#
16+
def test_max_day(self):
17+
converter = GregorianDateConverter()
18+
assert converter.max_day(2025, 1) == 31
19+
assert converter.max_day(2025, 2) == 28
20+
assert converter.max_day(converter.LEAP_YEAR, 2) == 29
21+
assert converter.max_day(2025, 12) == 31
22+
1823
def test_representative_years(self):
1924
converter = GregorianDateConverter()
2025
# single year is not filtered
@@ -24,7 +29,7 @@ def test_representative_years(self):
2429
# next leap year is 2028; returns first leap year and first non-leap year, in input order
2530
assert converter.representative_years([2025, 2026, 2028, 2029]) == [2025, 2028]
2631

27-
# if no years are provided, returns a known leap year and non-leap years
32+
# if no years are provided, returns a known leap year and non-leap year
2833
assert converter.representative_years() == [
2934
converter.LEAP_YEAR,
3035
converter.NON_LEAP_YEAR,

0 commit comments

Comments
 (0)