(self)
| 635 | list(calendar.standalone_month_abbr)) |
| 636 | |
| 637 | def test_locale_text_calendar(self): |
| 638 | try: |
| 639 | cal = calendar.LocaleTextCalendar(locale='') |
| 640 | local_weekday = cal.formatweekday(1, 10) |
| 641 | local_weekday_abbr = cal.formatweekday(1, 3) |
| 642 | local_month = cal.formatmonthname(2010, 10, 10) |
| 643 | except locale.Error: |
| 644 | # cannot set the system default locale -- skip rest of test |
| 645 | raise unittest.SkipTest('cannot set the system default locale') |
| 646 | self.assertIsInstance(local_weekday, str) |
| 647 | self.assertIsInstance(local_weekday_abbr, str) |
| 648 | self.assertIsInstance(local_month, str) |
| 649 | self.assertEqual(len(local_weekday), 10) |
| 650 | self.assertEqual(len(local_weekday_abbr), 3) |
| 651 | self.assertGreaterEqual(len(local_month), 10) |
| 652 | |
| 653 | cal = calendar.LocaleTextCalendar(locale=None) |
| 654 | local_weekday = cal.formatweekday(1, 10) |
| 655 | local_weekday_abbr = cal.formatweekday(1, 3) |
| 656 | local_month = cal.formatmonthname(2010, 10, 10) |
| 657 | self.assertIsInstance(local_weekday, str) |
| 658 | self.assertIsInstance(local_weekday_abbr, str) |
| 659 | self.assertIsInstance(local_month, str) |
| 660 | self.assertEqual(len(local_weekday), 10) |
| 661 | self.assertEqual(len(local_weekday_abbr), 3) |
| 662 | self.assertGreaterEqual(len(local_month), 10) |
| 663 | |
| 664 | cal = calendar.LocaleTextCalendar(locale='C') |
| 665 | local_weekday = cal.formatweekday(1, 10) |
| 666 | local_weekday_abbr = cal.formatweekday(1, 3) |
| 667 | local_month = cal.formatmonthname(2010, 10, 10) |
| 668 | self.assertIsInstance(local_weekday, str) |
| 669 | self.assertIsInstance(local_weekday_abbr, str) |
| 670 | self.assertIsInstance(local_month, str) |
| 671 | self.assertEqual(len(local_weekday), 10) |
| 672 | self.assertEqual(len(local_weekday_abbr), 3) |
| 673 | self.assertGreaterEqual(len(local_month), 10) |
| 674 | |
| 675 | def test_locale_html_calendar(self): |
| 676 | try: |
nothing calls this directly
no test coverage detected