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

Method test_gnu_translations_fallback

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

Source from the content-addressed store, hash-verified

802 'npgettext: context, foo, foos, 1')
803
804 def test_gnu_translations_fallback(self):
805 with open(MOFILE, 'rb') as fp:
806 t = gettext.GNUTranslations(fp)
807 t.add_fallback(FallbackTranslations())
808 self.assertEqual(t.gettext('foo'), 'gettext: foo')
809 self.assertEqual(t.ngettext('foo', 'foos', 1),
810 'ngettext: foo, foos, 1')
811 self.assertEqual(t.pgettext('context', 'foo'),
812 'pgettext: context, foo')
813 self.assertEqual(t.npgettext('context', 'foo', 'foos', 1),
814 'npgettext: context, foo, foos, 1')
815
816 def test_nested_fallbacks(self):
817 class NestedFallback(gettext.NullTranslations):

Callers

nothing calls this directly

Calls 8

gettextMethod · 0.95
ngettextMethod · 0.95
pgettextMethod · 0.95
npgettextMethod · 0.95
add_fallbackMethod · 0.80
openFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected