Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_gettext.GettextTestCase1 Class Reference
Inheritance diagram for test.test_gettext.GettextTestCase1:
Inheritance graph
[legend]
Collaboration diagram for test.test_gettext.GettextTestCase1:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test_some_translations
def test_double_quotes
def test_triple_single_quotes
def test_triple_double_quotes
def test_multiline_strings
def test_the_alternative_interface
def tearDown

Public Attributes

 localedir
 mofile
 env

Detailed Description

Definition at line 83 of file test_gettext.py.


Member Function Documentation

Reimplemented from test.test_gettext.GettextBaseTest.

Definition at line 84 of file test_gettext.py.

00084 
00085     def setUp(self):
00086         GettextBaseTest.setUp(self)
00087         self.localedir = os.curdir
00088         self.mofile = MOFILE
00089         gettext.install('gettext', self.localedir)

Here is the caller graph for this function:

def test.test_gettext.GettextBaseTest.tearDown (   self) [inherited]

Definition at line 77 of file test_gettext.py.

00077 
00078     def tearDown(self):
00079         self.env.__exit__()
00080         del self.env
00081         shutil.rmtree(os.path.split(LOCALEDIR)[0])
00082 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 98 of file test_gettext.py.

00098 
00099     def test_double_quotes(self):
00100         eq = self.assertEqual
00101         # double quotes
00102         eq(_("albatross"), 'albatross')
00103         eq(_("mullusk"), 'bacon')
00104         eq(_(r"Raymond Luxury Yach-t"), 'Throatwobbler Mangrove')
00105         eq(_(r"nudge nudge"), 'wink wink')

Here is the call graph for this function:

Definition at line 122 of file test_gettext.py.

00122 
00123     def test_multiline_strings(self):
00124         eq = self.assertEqual
00125         # multiline strings
00126         eq(_('''This module provides internationalization and localization
00127 support for your Python programs by providing an interface to the GNU
00128 gettext message catalog library.'''),
00129            '''Guvf zbqhyr cebivqrf vagreangvbanyvmngvba naq ybpnyvmngvba
00130 fhccbeg sbe lbhe Clguba cebtenzf ol cebivqvat na vagresnpr gb gur TAH
00131 trggrkg zrffntr pngnybt yvoenel.''')

Here is the call graph for this function:

Definition at line 90 of file test_gettext.py.

00090 
00091     def test_some_translations(self):
00092         eq = self.assertEqual
00093         # test some translations
00094         eq(_('albatross'), 'albatross')
00095         eq(_('mullusk'), 'bacon')
00096         eq(_(r'Raymond Luxury Yach-t'), 'Throatwobbler Mangrove')
00097         eq(_(r'nudge nudge'), 'wink wink')

Here is the call graph for this function:

Definition at line 132 of file test_gettext.py.

00132 
00133     def test_the_alternative_interface(self):
00134         eq = self.assertEqual
00135         # test the alternative interface
00136         with open(self.mofile, 'rb') as fp:
00137             t = gettext.GNUTranslations(fp)
00138         # Install the translation object
00139         t.install()
00140         eq(_('nudge nudge'), 'wink wink')
00141         # Try unicode return type
00142         t.install()
00143         eq(_('mullusk'), 'bacon')
00144         # Test installation of other methods
00145         import builtins
00146         t.install(names=["gettext", "lgettext"])
00147         eq(_, t.gettext)
00148         eq(builtins.gettext, t.gettext)
00149         eq(lgettext, t.lgettext)
00150         del builtins.gettext
00151         del builtins.lgettext
00152 

Here is the call graph for this function:

Definition at line 114 of file test_gettext.py.

00114 
00115     def test_triple_double_quotes(self):
00116         eq = self.assertEqual
00117         # triple double quotes
00118         eq(_("""albatross"""), 'albatross')
00119         eq(_("""mullusk"""), 'bacon')
00120         eq(_(r"""Raymond Luxury Yach-t"""), 'Throatwobbler Mangrove')
00121         eq(_(r"""nudge nudge"""), 'wink wink')

Here is the call graph for this function:

Definition at line 106 of file test_gettext.py.

00106 
00107     def test_triple_single_quotes(self):
00108         eq = self.assertEqual
00109         # triple single quotes
00110         eq(_('''albatross'''), 'albatross')
00111         eq(_('''mullusk'''), 'bacon')
00112         eq(_(r'''Raymond Luxury Yach-t'''), 'Throatwobbler Mangrove')
00113         eq(_(r'''nudge nudge'''), 'wink wink')

Here is the call graph for this function:


Member Data Documentation

Definition at line 73 of file test_gettext.py.

Definition at line 86 of file test_gettext.py.

Definition at line 87 of file test_gettext.py.


The documentation for this class was generated from the following file: