MCPcopy Index your code
hub / github.com/python/cpython / test_locale_html_calendar

Method test_locale_html_calendar

Lib/test/test_calendar.py:675–696  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

673 self.assertGreaterEqual(len(local_month), 10)
674
675 def test_locale_html_calendar(self):
676 try:
677 cal = calendar.LocaleHTMLCalendar(locale='')
678 local_weekday = cal.formatweekday(1)
679 local_month = cal.formatmonthname(2010, 10)
680 except locale.Error:
681 # cannot set the system default locale -- skip rest of test
682 raise unittest.SkipTest('cannot set the system default locale')
683 self.assertIsInstance(local_weekday, str)
684 self.assertIsInstance(local_month, str)
685
686 cal = calendar.LocaleHTMLCalendar(locale=None)
687 local_weekday = cal.formatweekday(1)
688 local_month = cal.formatmonthname(2010, 10)
689 self.assertIsInstance(local_weekday, str)
690 self.assertIsInstance(local_month, str)
691
692 cal = calendar.LocaleHTMLCalendar(locale='C')
693 local_weekday = cal.formatweekday(1)
694 local_month = cal.formatmonthname(2010, 10)
695 self.assertIsInstance(local_weekday, str)
696 self.assertIsInstance(local_month, str)
697
698 def test_locale_calendars_reset_locale_properly(self):
699 # ensure that Locale{Text,HTML}Calendar resets the locale properly

Callers

nothing calls this directly

Calls 3

formatweekdayMethod · 0.95
formatmonthnameMethod · 0.95
assertIsInstanceMethod · 0.80

Tested by

no test coverage detected