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

Method test_the_alternative_interface

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

Source from the content-addressed store, hash-verified

241trggrkg zrffntr pngnybt yvoenel.''')
242
243 def test_the_alternative_interface(self):
244 eq = self.assertEqual
245 neq = self.assertNotEqual
246 # test the alternative interface
247 with open(self.mofile, 'rb') as fp:
248 t = gettext.GNUTranslations(fp)
249 # Install the translation object
250 t.install()
251 eq(_('nudge nudge'), 'wink wink')
252 # Try unicode return type
253 t.install()
254 eq(_('mullusk'), 'bacon')
255 # Test installation of other methods
256 import builtins
257 t.install(names=["gettext", "ngettext"])
258 eq(_, t.gettext)
259 eq(builtins.gettext, t.gettext)
260 eq(ngettext, t.ngettext)
261 neq(pgettext, t.pgettext)
262 del builtins.gettext
263 del builtins.ngettext
264
265
266class GettextTestCase2(GettextBaseTest):

Callers

nothing calls this directly

Calls 4

eqFunction · 0.85
_Function · 0.70
openFunction · 0.50
installMethod · 0.45

Tested by

no test coverage detected