summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-07-08 15:49:59 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-07-08 15:49:59 (GMT)
commitbf5af5d5bc40db83464d1a04ddb765199245bf10 (patch)
treee3c0ffebebe426fb372d8fe51abb9cd3c15f520b
parent49fc8ece8172162510890f42127d2aa4e13f878b (diff)
parentf84e01df318e625e958ccccf566c8a01eea6ff6b (diff)
downloadcpython-bf5af5d5bc40db83464d1a04ddb765199245bf10.zip
cpython-bf5af5d5bc40db83464d1a04ddb765199245bf10.tar.gz
cpython-bf5af5d5bc40db83464d1a04ddb765199245bf10.tar.bz2
Merge str.center tests from 3.3.
-rw-r--r--Lib/test/test_unicode.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 518d6d6..00c0fff 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -663,6 +663,15 @@ class UnicodeTest(string_tests.CommonTest,
self.assertEqual('ß'.swapcase(), 'SS')
self.assertEqual('\u1fd2'.swapcase(), '\u0399\u0308\u0300')
+ def test_center(self):
+ string_tests.CommonTest.test_center(self)
+ self.assertEqual('x'.center(2, '\U0010FFFF'),
+ 'x\U0010FFFF')
+ self.assertEqual('x'.center(3, '\U0010FFFF'),
+ '\U0010FFFFx\U0010FFFF')
+ self.assertEqual('x'.center(4, '\U0010FFFF'),
+ '\U0010FFFFx\U0010FFFF\U0010FFFF')
+
def test_contains(self):
# Testing Unicode contains method
self.assertIn('a', 'abdb')