Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 693c6c4

Browse files
author
Skip Montanaro
committed
added test case to catch index errors with _localized_name class
1 parent b323021 commit 693c6c4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_calendar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def test_setfirstweekday(self):
2626
self.assertEqual(calendar.firstweekday(), calendar.MONDAY)
2727
calendar.setfirstweekday(orig)
2828

29+
def test_enumerateweekdays(self):
30+
self.assertRaises(IndexError, calendar.day_abbr.__getitem__, -10)
31+
self.assertRaises(IndexError, calendar.day_name.__getitem__, 10)
32+
self.assertEqual(len([d for d in calendar.day_abbr]), 7)
2933

3034
def test_main():
3135
run_unittest(CalendarTestCase)

0 commit comments

Comments
 (0)