Commit Graph

22 Commits

Author SHA1 Message Date
Éric Araujo c17776f96e Merged revisions 85223 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85223 | eric.araujo | 2010-10-05 01:52:37 +0200 (mar., 05 oct. 2010) | 3 lines

  Fix interaction of custom translation classes and caching (#9042)
........
2010-10-04 23:59:35 +00:00
Benjamin Peterson 5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Walter Dörwald 6733bed57e Make test.test_support.EnvironmentVarGuard behave like a dictionary.
All changes are mirrored to the underlying os.environ dict, but rolled back
on exit from the with block.
2009-05-01 17:35:37 +00:00
Collin Winter c2898c5a67 Standardize on test.test_support.run_unittest() (as opposed to a mix of run_unittest() and run_suite()). Also, add functionality to run_unittest() that admits usage of unittest.TestLoader.loadTestsFromModule(). 2007-04-25 17:29:52 +00:00
Georg Brandl 602b9ba6b3 Patch #1349274: gettext.install() now optionally installs additional
translation functions other than _() in the builtin namespace.
2006-02-19 13:26:36 +00:00
Neal Norwitz a0e0cd3013 Don't try to create the directory if it already exists, otherwise the test fails 2004-07-19 00:08:59 +00:00
Barry Warsaw e960e22579 Added a test for the fix of SF bug #658233, where continuation lines
in .po metadata caused a crash.

Also, removed some unnecessary code.

Backport candidate.
2003-05-20 17:28:54 +00:00
Brett Cannon 4aebbb0449 Make tests clean up after themselves better. This means:
* call tearDown when Setup is called
* shutil.rmtree the root of the created directory instead of just the leaf
  directory
* set the LANGUAGE environment variable to what it was originally and not
  assume 'en'.
2003-04-27 19:42:41 +00:00
Barry Warsaw edb155fda1 UnicodeTranslationsTest.setUp(): Removed the coerce flag to the
GNUTranslations constructor.
2003-04-24 18:08:13 +00:00
Tim Peters 0eadaac7dc Whitespace normalization. 2003-04-24 16:02:54 +00:00
Barry Warsaw a1ce93f87c From http://mail.python.org/pipermail/i18n-sig/2003-April/001557.html
- Expose NullTranslations and GNUTranslations to __all__

- Set the default charset to iso-8859-1.  It used to be None, which
would cause problems with .ugettext() if the file had no charset
parameter.  Arguably, the po/mo file would be broken, but I still think
iso-8859-1 is a reasonable default.

- Add a "coerce" default argument to GNUTranslations's constructor.  The
reason for this is that in Zope, we want all msgids and msgstrs to be
Unicode.  For the latter, we could use .ugettext() but there isn't
currently a mechanism for Unicode-ifying msgids.

The plan then is that the charset parameter specifies the encoding for
both the msgids and msgstrs, and both are decoded to Unicode when read.
For example, we might encode po files with utf-8. I think the GNU
gettext tools don't care.

Since this could potentially break code [*] that wants to use the
encoded interface .gettext(), the constructor flag is added, defaulting
to False.  Most code I suspect will want to set this to True and use
.ugettext().

- A few other minor changes from the Zope project, including asserting
that a zero-length msgid must have a Project-ID-Version header for it to
be counted as the metadata record.
2003-04-11 18:36:43 +00:00
Martin v. Löwis d899605e30 Patch #633547: Support plural forms. Do TODOs in test suite. 2002-11-21 21:45:32 +00:00
Guido van Rossum 65692578b7 Move the setting of os.environ['LANGUAGE'] to setup(), and reset it to
'en' in teardown().  This way hopefully test_time.py won't fail.
2002-07-20 00:36:38 +00:00
Barry Warsaw 08f9956261 Update an email address. 2001-08-28 21:26:33 +00:00
Barry Warsaw 191487351a Quick and dirty fix for test_extcall failures trigged by Guido's
recent classobject.c change.  When calling an unbound method with no
instances as first argument, the error message has changed.  The
message now contains the class name, but the output text being
compared to is too generic, so skip printing it.
2001-08-24 19:11:57 +00:00
Fred Drake 004d5e6880 Make reindent.py happy (convert everything to 4-space indents!). 2000-10-23 17:22:08 +00:00
Jack Jansen 8b7c3c0be7 For current directory use os.curdir, not ".". 2000-09-15 12:58:08 +00:00
Barry Warsaw 64dab4602e Expand the test suite to test both the GNU gettext and translation
class-based APIs.
2000-08-30 03:32:07 +00:00
Tim Peters c79519569d Open binary files in binary mode. Fixes test failure under Windows. 2000-08-26 21:01:27 +00:00
Barry Warsaw 1dce09da61 Group consensus is that supporting alternative locale categories is
useless.  So the test of the dcgettext() function is removed.
2000-08-25 19:53:51 +00:00
Barry Warsaw ff6d813657 Set this test up so that we don't have to create xx/LC_MESSAGES in the
cvs tree.  It creates the directory and gettext.mo file on the fly,
from the base64 encode binary data.
2000-08-25 19:50:38 +00:00
Barry Warsaw 9e03592149 Test suite for new gettext.py module. 2000-08-25 19:14:25 +00:00