mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
added test case to catch index errors with _localized_name class
This commit is contained in:
parent
b32302176e
commit
693c6c44c4
1 changed files with 4 additions and 0 deletions
|
|
@ -26,6 +26,10 @@ class CalendarTestCase(unittest.TestCase):
|
||||||
self.assertEqual(calendar.firstweekday(), calendar.MONDAY)
|
self.assertEqual(calendar.firstweekday(), calendar.MONDAY)
|
||||||
calendar.setfirstweekday(orig)
|
calendar.setfirstweekday(orig)
|
||||||
|
|
||||||
|
def test_enumerateweekdays(self):
|
||||||
|
self.assertRaises(IndexError, calendar.day_abbr.__getitem__, -10)
|
||||||
|
self.assertRaises(IndexError, calendar.day_name.__getitem__, 10)
|
||||||
|
self.assertEqual(len([d for d in calendar.day_abbr]), 7)
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
run_unittest(CalendarTestCase)
|
run_unittest(CalendarTestCase)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue