From 6c0a2fd1e2cfe53e84160c7985680794d2e4fb25 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 20 Jan 2006 17:48:57 +0000 Subject: [PATCH] Checkin the test of patch #1400181. --- Lib/test/test_unicode.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 16356b00957f..7f8cf5097c0e 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -390,6 +390,20 @@ class UnicodeTest( 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) -- 2.47.3