summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_calendar.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2002-03-15 03:57:04 (GMT)
committerSkip Montanaro <skip@pobox.com>2002-03-15 03:57:04 (GMT)
commit693c6c44c4db6049bc53da51fbd1a084a33a75b2 (patch)
tree1162fc426fb504f2f07ab453a88ae6151f7d68ac /Lib/test/test_calendar.py
parentb32302176e127a94b714f90c858b6e9c476fc7fe (diff)
downloadcpython-693c6c44c4db6049bc53da51fbd1a084a33a75b2.zip
cpython-693c6c44c4db6049bc53da51fbd1a084a33a75b2.tar.gz
cpython-693c6c44c4db6049bc53da51fbd1a084a33a75b2.tar.bz2
added test case to catch index errors with _localized_name class
Diffstat (limited to 'Lib/test/test_calendar.py')
-rw-r--r--Lib/test/test_calendar.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index 1807a59..eed96ef 100644
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -26,6 +26,10 @@ class CalendarTestCase(unittest.TestCase):
self.assertEqual(calendar.firstweekday(), calendar.MONDAY)
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():
run_unittest(CalendarTestCase)