diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-09-15 01:05:04 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-09-15 01:05:04 (GMT) |
commit | 5589bd109adf9cdf1eec9ad78d4250b9f9b078ea (patch) | |
tree | 980d687688d83eca9ab9e58231f4c6ad027c8051 | |
parent | 7c89ae206e6fc7dc08c789f9f9db7094f6723419 (diff) | |
parent | 0a32d92bffc9c845253718c43e7ae91cf62bacda (diff) | |
download | cpython-5589bd109adf9cdf1eec9ad78d4250b9f9b078ea.zip cpython-5589bd109adf9cdf1eec9ad78d4250b9f9b078ea.tar.gz cpython-5589bd109adf9cdf1eec9ad78d4250b9f9b078ea.tar.bz2 |
#18856: merge with 3.3.
-rw-r--r-- | Lib/test/test_calendar.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index 8adf5bd..f680b52 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -399,6 +399,27 @@ class OutputTestCase(unittest.TestCase): '<tr><th colspan="7" class="month">January</th></tr>' ) + def test_prweek(self): + with support.captured_stdout() as out: + week = [(1,0), (2,1), (3,2), (4,3), (5,4), (6,5), (7,6)] + calendar.TextCalendar().prweek(week, 1) + self.assertEqual(out.getvalue().strip(), "1 2 3 4 5 6 7") + + def test_prmonth(self): + with support.captured_stdout() as out: + calendar.TextCalendar().prmonth(2004, 1) + output = out.getvalue().strip() + self.assertEqual(output, result_2004_01_text.strip()) + + def test_pryear(self): + with support.captured_stdout() as out: + calendar.TextCalendar().pryear(2004) + self.assertEqual(out.getvalue().strip(), result_2004_text.strip()) + + def test_format(self): + with support.captured_stdout() as out: + calendar.format(["1", "2", "3"], colwidth=3, spacing=1) + self.assertEqual(out.getvalue().strip(), "1 2 3") class CalendarTestCase(unittest.TestCase): def test_isleap(self): |