Issue #3751: str.rpartition would perform a left-partition when called with

a unicode argument.

Backport of r66119
This commit is contained in:
Amaury Forgeot d'Arc 2008-09-01 20:05:08 +00:00
parent 50b1c4920b
commit afa0d58a2d
3 changed files with 9 additions and 1 deletions

View file

@ -1066,6 +1066,9 @@ class MixinStrUnicodeUserStringTest:
self.checkraises(ValueError, S, 'partition', '')
self.checkraises(TypeError, S, 'partition', None)
# mixed use of str and unicode
self.assertEqual('a/b/c'.partition(u'/'), ('a', '/', 'b/c'))
def test_rpartition(self):
self.checkequal(('this is the rparti', 'ti', 'on method'),
@ -1081,6 +1084,8 @@ class MixinStrUnicodeUserStringTest:
self.checkraises(ValueError, S, 'rpartition', '')
self.checkraises(TypeError, S, 'rpartition', None)
# mixed use of str and unicode
self.assertEqual('a/b/c'.rpartition(u'/'), ('a/b', '/', 'c'))
class MixinStrStringUserStringTest:
# Additional tests for 8bit strings, i.e. str, UserString and