From 5b4bc61d897c956c245a907807d0073aaa35f1c3 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 4 Apr 2022 10:41:50 -0700 Subject: [PATCH] bpo-46484:Add test for Calendar.iterweekdays (GH-30825) (cherry picked from commit 48269ea9fdbc5804f80962364f95e69097c417ba) Co-authored-by: 180909 <734461790@qq.com> --- Lib/test/test_calendar.py | 8 ++++++++ Misc/ACKS | 1 + 2 files changed, 9 insertions(+) diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index 6241d114d338..d6170c7e814f 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -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): diff --git a/Misc/ACKS b/Misc/ACKS index d043195a7b55..d8bb5e465015 100644 --- 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 -- 2.47.3