]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46484:Add test for Calendar.iterweekdays (GH-30825)
author180909 <734461790@qq.com>
Mon, 4 Apr 2022 17:16:56 +0000 (01:16 +0800)
committerGitHub <noreply@github.com>
Mon, 4 Apr 2022 17:16:56 +0000 (18:16 +0100)
Lib/test/test_calendar.py
Misc/ACKS

index e6bd4d03e0f63f5168730ec27d5643e75fecbb17..f76cbc9472a6e8fd242fe33148ea67844a1792a7 100644 (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):
index 72e2cfe13775af74fd14ea034380c7d2515c3198..33e1c4c492983c5cf9bd014533bfac4c0cd5f472 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1886,6 +1886,7 @@ Jacob Walls
 Kevin Walzer
 Rodrigo Steinmuller Wanderley
 Dingyuan Wang
+Jiahua Wang
 Ke Wang
 Liang-Bo Wang
 Greg Ward