[Python-checkins] r42111 - python/branches/release24-maint/Lib/test/test_unicode.py
georg.brandl
python-checkins at python.org
Fri Jan 20 18:48:58 CET 2006
Author: georg.brandl
Date: Fri Jan 20 18:48:57 2006
New Revision: 42111
Modified:
python/branches/release24-maint/Lib/test/test_unicode.py
Log:
Checkin the test of patch #1400181.
Modified: python/branches/release24-maint/Lib/test/test_unicode.py
==============================================================================
--- python/branches/release24-maint/Lib/test/test_unicode.py (original)
+++ python/branches/release24-maint/Lib/test/test_unicode.py Fri Jan 20 18:48:57 2006
@@ -390,6 +390,20 @@
self.assertEqual('%c' % u'a', u'a')
+ def test_format_float(self):
+ try:
+ import locale
+ orig_locale = locale.setlocale(locale.LC_ALL)
+ locale.setlocale(locale.LC_ALL, 'de_DE')
+ except (ImportError, locale.Error):
+ return # skip if we can't set locale
+
+ try:
+ # should not format with a comma, but always with C locale
+ self.assertEqual(u'1.0', u'%.1f' % 1.0)
+ finally:
+ locale.setlocale(locale.LC_ALL, orig_locale)
+
def test_constructor(self):
# unicode(obj) tests (this maps to PyObject_Unicode() at C level)
More information about the Python-checkins
mailing list