]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46484:Add test for Calendar.iterweekdays (GH-30825)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 4 Apr 2022 17:41:50 +0000 (10:41 -0700)
committerGitHub <noreply@github.com>
Mon, 4 Apr 2022 17:41:50 +0000 (10:41 -0700)
(cherry picked from commit 48269ea9fdbc5804f80962364f95e69097c417ba)

Co-authored-by: 180909 <734461790@qq.com>
Lib/test/test_calendar.py
Misc/ACKS

index 6241d114d33823784790c4bf1db10c81aa75050c..d6170c7e814fa77534faaaae79c124961689fc7b 100644 (file)
@@ -595,6 +595,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):
index d043195a7b550ac1ec52a2c211880f9844f036a0..d8bb5e465015d72ec5a8d176e4038081d6ade8a4 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1840,6 +1840,7 @@ Jacob Walls
 Kevin Walzer
 Rodrigo Steinmuller Wanderley
 Dingyuan Wang
+Jiahua Wang
 Ke Wang
 Liang-Bo Wang
 Greg Ward