mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
bpo-46484:Add test for Calendar.iterweekdays (GH-30825)
(cherry picked from commit 48269ea9fd)
Co-authored-by: 180909 <734461790@qq.com>
This commit is contained in:
parent
29ffac2d39
commit
6b4b892e09
2 changed files with 9 additions and 0 deletions
|
|
@ -619,6 +619,14 @@ def test_itermonthdays2(self):
|
||||||
self.assertEqual(days[0][1], firstweekday)
|
self.assertEqual(days[0][1], firstweekday)
|
||||||
self.assertEqual(days[-1][1], (firstweekday - 1) % 7)
|
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):
|
class MonthCalendarTestCase(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
|
||||||
|
|
@ -1875,6 +1875,7 @@ Jacob Walls
|
||||||
Kevin Walzer
|
Kevin Walzer
|
||||||
Rodrigo Steinmuller Wanderley
|
Rodrigo Steinmuller Wanderley
|
||||||
Dingyuan Wang
|
Dingyuan Wang
|
||||||
|
Jiahua Wang
|
||||||
Ke Wang
|
Ke Wang
|
||||||
Liang-Bo Wang
|
Liang-Bo Wang
|
||||||
Greg Ward
|
Greg Ward
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue