Skip to content

Commit 0f9c3d4

Browse files
miss-islington180909
authored andcommitted
bpo-46484:Add test for Calendar.iterweekdays (pythonGH-30825)
(cherry picked from commit 48269ea) Co-authored-by: 180909 <[email protected]>
1 parent 56d1450 commit 0f9c3d4

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
@@ -595,6 +595,14 @@ def test_itermonthdays2(self):
595595
self.assertEqual(days[0][1], firstweekday)
596596
self.assertEqual(days[-1][1], (firstweekday - 1) % 7)
597597

598+
def test_iterweekdays(self):
599+
week0 = list(range(7))
600+
for firstweekday in range(7):
601+
cal = calendar.Calendar(firstweekday)
602+
week = list(cal.iterweekdays())
603+
expected = week0[firstweekday:] + week0[:firstweekday]
604+
self.assertEqual(week, expected)
605+
598606

599607
class MonthCalendarTestCase(unittest.TestCase):
600608
def setUp(self):

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,6 +1840,7 @@ Jacob Walls
18401840
Kevin Walzer
18411841
Rodrigo Steinmuller Wanderley
18421842
Dingyuan Wang
1843+
Jiahua Wang
18431844
Ke Wang
18441845
Liang-Bo Wang
18451846
Greg Ward

0 commit comments

Comments
 (0)