From: Georg Brandl Date: Fri, 20 Jan 2006 17:48:57 +0000 (+0000) Subject: Checkin the test of patch #1400181. X-Git-Tag: v2.4.3c1~124 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6c0a2fd1e2cfe53e84160c7985680794d2e4fb25;p=thirdparty%2FPython%2Fcpython.git Checkin the test of patch #1400181. --- 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)