Skip to content

Commit 48269ea

Browse files
authored
bpo-46484:Add test for Calendar.iterweekdays (pythonGH-30825)
1 parent d1b1c88 commit 48269ea

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Lib/test/test_calendar.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,14 @@ def test_itermonthdays2(self):
619619
self.assertEqual(days[0][1], firstweekday)
620620
self.assertEqual(days[-1][1], (firstweekday - 1) % 7)
621621

622+
def test_iterweekdays(self):
623+
week0 = list(range(7))
624+
for firstweekday in range(7):
625+
cal = calendar.Calendar(firstweekday)
626+
week = list(cal.iterweekdays())
627+
expected = week0[firstweekday:] + week0[:firstweekday]
628+
self.assertEqual(week, expected)
629+
622630

623631
class MonthCalendarTestCase(unittest.TestCase):
624632
def setUp(self):

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,7 @@ Jacob Walls
18861886
Kevin Walzer
18871887
Rodrigo Steinmuller Wanderley
18881888
Dingyuan Wang
1889+
Jiahua Wang
18891890
Ke Wang
18901891
Liang-Bo Wang
18911892
Greg Ward

0 commit comments

Comments
 (0)