summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_calendar.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-03-23 03:26:53 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-03-23 03:26:53 (GMT)
commit0c2c8e77fba38a68554b264a2985000d3006d8d1 (patch)
tree0f9894a98f8b723e0951e8f845d3232776436ecf /Lib/test/test_calendar.py
parented19b88f0b203bea32c9193009143e71f40f355f (diff)
downloadcpython-0c2c8e77fba38a68554b264a2985000d3006d8d1.zip
cpython-0c2c8e77fba38a68554b264a2985000d3006d8d1.tar.gz
cpython-0c2c8e77fba38a68554b264a2985000d3006d8d1.tar.bz2
SF bug 533234: tm_isdst > 1 Passed to strftime.
One more time on this turkey, but duller instead of cleverer. Curious: The docs say __getslice__ has been deprecated since 2.0, but list.__getitem__ still doesn't work if you pass it a slice. This makes it a lot clearer to emulate a list by *being* a list <wink>. Bugfix candidate. Michael, just pile this patch on top of the others that went by -- no need to try to pick these apart.
Diffstat (limited to 'Lib/test/test_calendar.py')
-rw-r--r--Lib/test/test_calendar.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index eed96ef..2059eaf 100644
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -31,6 +31,29 @@ class CalendarTestCase(unittest.TestCase):
self.assertRaises(IndexError, calendar.day_name.__getitem__, 10)
self.assertEqual(len([d for d in calendar.day_abbr]), 7)
+ def test_days(self):
+ for attr in "day_name", "day_abbr":
+ value = getattr(calendar, attr)
+ self.assertEqual(len(value), 7)
+ self.assertEqual(len(value[:]), 7)
+ # ensure they're all unique
+ d = {}
+ for v in value:
+ d[v] = 1
+ self.assertEqual(len(d), 7)
+
+ def test_months(self):
+ for attr in "month_name", "month_abbr":
+ value = getattr(calendar, attr)
+ self.assertEqual(len(value), 13)
+ self.assertEqual(len(value[:]), 13)
+ self.assertEqual(value[0], "")
+ # ensure they're all unique
+ d = {}
+ for v in value:
+ d[v] = 1
+ self.assertEqual(len(d), 13)
+
def test_main():
run_unittest(CalendarTestCase)