diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-04-04 10:43:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-04 10:43:38 -0700 |
commit | 6b4b892e0962a7050c5064133c59955691f9776c (patch) | |
tree | 89e8888dfb7f98592d0c12b3c65437511b2c7056 | |
parent | 29ffac2d39f7e45834880e359e1bda9a4152f016 (diff) | |
download | cpython-git-6b4b892e0962a7050c5064133c59955691f9776c.tar.gz |
bpo-46484:Add test for Calendar.iterweekdays (GH-30825)
(cherry picked from commit 48269ea9fdbc5804f80962364f95e69097c417ba)
Co-authored-by: 180909 <734461790@qq.com>
-rw-r--r-- | Lib/test/test_calendar.py | 8 | ||||
-rw-r--r-- | Misc/ACKS | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index 39094ad6fd..5ae2b66ff3 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): @@ -1875,6 +1875,7 @@ Jacob Walls Kevin Walzer Rodrigo Steinmuller Wanderley Dingyuan Wang +Jiahua Wang Ke Wang Liang-Bo Wang Greg Ward |