Commit 67e83886 authored by Walter Dörwald's avatar Walter Dörwald

test_unicode.py passes again 9except for problems

with the idna codec.
parent acaa5a16
...@@ -642,17 +642,6 @@ class CommonTest(BaseTest): ...@@ -642,17 +642,6 @@ class CommonTest(BaseTest):
self.checkequal('xyzzyhello', 'xyzzyhelloxyzzy', 'rstrip', 'xyz') self.checkequal('xyzzyhello', 'xyzzyhelloxyzzy', 'rstrip', 'xyz')
self.checkequal('hello', 'hello', 'strip', 'xyz') self.checkequal('hello', 'hello', 'strip', 'xyz')
# strip/lstrip/rstrip with unicode arg
if test_support.have_unicode:
self.checkequal(str('hello', 'ascii'), 'xyzzyhelloxyzzy',
'strip', str('xyz', 'ascii'))
self.checkequal(str('helloxyzzy', 'ascii'), 'xyzzyhelloxyzzy',
'lstrip', str('xyz', 'ascii'))
self.checkequal(str('xyzzyhello', 'ascii'), 'xyzzyhelloxyzzy',
'rstrip', str('xyz', 'ascii'))
self.checkequal(str('hello', 'ascii'), 'hello',
'strip', str('xyz', 'ascii'))
self.checkraises(TypeError, 'hello', 'strip', 42, 42) self.checkraises(TypeError, 'hello', 'strip', 42, 42)
self.checkraises(TypeError, 'hello', 'lstrip', 42, 42) self.checkraises(TypeError, 'hello', 'lstrip', 42, 42)
self.checkraises(TypeError, 'hello', 'rstrip', 42, 42) self.checkraises(TypeError, 'hello', 'rstrip', 42, 42)
...@@ -956,12 +945,8 @@ class MixinStrUnicodeUserStringTest: ...@@ -956,12 +945,8 @@ class MixinStrUnicodeUserStringTest:
self.checkequal('w x y z', ' ', 'join', Sequence()) self.checkequal('w x y z', ' ', 'join', Sequence())
self.checkequal('abc', 'a', 'join', ('abc',)) self.checkequal('abc', 'a', 'join', ('abc',))
self.checkequal('z', 'a', 'join', UserList(['z'])) self.checkequal('z', 'a', 'join', UserList(['z']))
if test_support.have_unicode: self.checkequal('a.b.c', '.', 'join', ['a', 'b', 'c'])
self.checkequal(str('a.b.c'), str('.'), 'join', ['a', 'b', 'c']) self.checkraises(TypeError, '.', 'join', ['a', 'b', 3])
self.checkequal(str('a.b.c'), '.', 'join', [str('a'), 'b', 'c'])
self.checkequal(str('a.b.c'), '.', 'join', ['a', str('b'), 'c'])
self.checkequal(str('a.b.c'), '.', 'join', ['a', 'b', str('c')])
self.checkraises(TypeError, '.', 'join', ['a', str('b'), 3])
for i in [5, 25, 125]: for i in [5, 25, 125]:
self.checkequal(((('a' * i) + '-') * i)[:-1], '-', 'join', self.checkequal(((('a' * i) + '-') * i)[:-1], '-', 'join',
['a' * i] * i) ['a' * i] * i)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment