From: 180909 <734461790@qq.com> Date: Mon, 4 Apr 2022 17:16:56 +0000 (+0800) Subject: bpo-46484:Add test for Calendar.iterweekdays (GH-30825) X-Git-Tag: v3.11.0a7~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48269ea9fdbc5804f80962364f95e69097c417ba;p=thirdparty%2FPython%2Fcpython.git bpo-46484:Add test for Calendar.iterweekdays (GH-30825) --- diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index e6bd4d03e0f6..f76cbc9472a6 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -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): diff --git a/Misc/ACKS b/Misc/ACKS index 72e2cfe13775..33e1c4c49298 100644 --- 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