mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
Merge str.center tests from 3.3.
This commit is contained in:
commit
bf5af5d5bc
1 changed files with 9 additions and 0 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue