summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-01-20 17:48:54 (GMT)
committerGeorg Brandl <georg@python.org>2006-01-20 17:48:54 (GMT)
commitda6b107745f7fd0a3b85c0fd82fcda4743995a0a (patch)
tree99c6897dfc43ef14e6bb4da4e14607774401fef6
parent89f35ac180ad4ae667a35b4c8060bee426dda27a (diff)
downloadcpython-da6b107745f7fd0a3b85c0fd82fcda4743995a0a.zip
cpython-da6b107745f7fd0a3b85c0fd82fcda4743995a0a.tar.gz
cpython-da6b107745f7fd0a3b85c0fd82fcda4743995a0a.tar.bz2
Checkin the test of patch #1400181.
-rw-r--r--Lib/test/test_unicode.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 3a9b46c..49ef29d 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -411,6 +411,20 @@ class UnicodeTest(
return u'\u1234'
self.assertEqual('%s' % Wrapper(), u'\u1234')
+ 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)