itertools
gregorian
test_year_is_leap
test_year_is_leap(test)
mfd_io_samples
mfd_io_samples = [
(0, 0), # first day of jan
(1, 0),
(2, 0),
(30, 0), # last day of january
(31, 1), # first day of feb
((365*4) + 1, (12 * 4)),
# century
(((365*4) + 1) * 25, (12 * 4 * 25)),
# next century
((((365*4) + 1) * 25) + 30, (12 * 4 * 25)),
((((365*4) + 1) * 25) + 31, (12 * 4 * 25) + 1),
# now the skipped leap of the second century in the cycle.
((((365*4) + 1) * 25) + 31 + 27, (12 * 4 * 25) + 1),
((((365*4) + 1) * 25) + 31 + 28, (12 * 4 * 25) + 2),
# now to the following four-year cycle to check for leap presence
((((365*4) + 1) * 26) - 1 + 31 + 28, (12 * 4 * 26) + 1),
((((365*4) + 1) * 26) - 1 + 31 + 29, (12 * 4 * 26) + 2),
]
test_month_from_days
test_month_from_days(test)
test_mfd_alignment
test_mfd_alignment(test)
test_scan_months
test_scan_months(test)
Shows month_from_days aligning at the start of the month.
dfm_io_samples
dfm_io_samples = [
(0, 0),
(1, 31),
(2, 60),
]
test_days_from_month
test_days_from_month(test)
date_io_samples
date_io_samples = [
# whole cycle checks
((2400,1,1), 6 * gregorian.days_in_cycle),
((2000,1,1), 5 * gregorian.days_in_cycle),
((1600,1,1), 4 * gregorian.days_in_cycle),
((1200,1,1), 3 * gregorian.days_in_cycle),
((800,1,1), 2 * gregorian.days_in_cycle),
((400,1,1), gregorian.days_in_cycle),
((0,1,1), 0),
# and one
((0,1,2), 1),
# and two
((400,1,3), 2 + gregorian.days_in_cycle),
]
test_date_from_days
test_date_from_days(test)
test_days_from_date
test_days_from_date(test)