bpo-46484:Add test for Calendar.iterweekdays (GH-30825)
(cherry picked from commit 48269ea9fdbc5804f80962364f95e69097c417ba)
Co-authored-by: 180909 <734461790@qq.com>
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index 39094ad..5ae2b66 100644
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -619,6 +619,14 @@ def test_itermonthdays2(self):
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):
diff --git a/Misc/ACKS b/Misc/ACKS
index 1f1364e..ab4a037 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1875,6 +1875,7 @@
Kevin Walzer
Rodrigo Steinmuller Wanderley
Dingyuan Wang
+Jiahua Wang
Ke Wang
Liang-Bo Wang
Greg Ward