bpo-46484:Add test for Calendar.iterweekdays (GH-30825)

This commit is contained in:
180909 2022-04-05 01:16:56 +08:00 committed by GitHub
parent d1b1c885d8
commit 48269ea9fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -619,6 +619,14 @@ class CalendarTestCase(unittest.TestCase):
self.assertEqual(days[0][1], firstweekday)
self.assertEqual(days[-1][1], (firstweekday - 1) % 7)
def test_iterweekdays(self):
week0 = list(range(7))
for firstweekday in range(7):
cal = calendar.Calendar(firstweekday)
week = list(cal.iterweekdays())
expected = week0[firstweekday:] + week0[:firstweekday]
self.assertEqual(week, expected)
class MonthCalendarTestCase(unittest.TestCase):
def setUp(self):

View File

@ -1886,6 +1886,7 @@ Jacob Walls
Kevin Walzer
Rodrigo Steinmuller Wanderley
Dingyuan Wang
Jiahua Wang
Ke Wang
Liang-Bo Wang
Greg Ward