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

Method test_null_translations_fallback

Lib/test/test_gettext.py:793–802  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

791
792class FallbackTestCase(GettextBaseTest):
793 def test_null_translations_fallback(self):
794 t = gettext.NullTranslations()
795 t.add_fallback(FallbackTranslations())
796 self.assertEqual(t.gettext('foo'), 'gettext: foo')
797 self.assertEqual(t.ngettext('foo', 'foos', 1),
798 'ngettext: foo, foos, 1')
799 self.assertEqual(t.pgettext('context', 'foo'),
800 'pgettext: context, foo')
801 self.assertEqual(t.npgettext('context', 'foo', 'foos', 1),
802 'npgettext: context, foo, foos, 1')
803
804 def test_gnu_translations_fallback(self):
805 with open(MOFILE, 'rb') as fp:

Callers

nothing calls this directly

Calls 7

add_fallbackMethod · 0.95
gettextMethod · 0.95
ngettextMethod · 0.95
pgettextMethod · 0.95
npgettextMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected