mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Issue #3751: str.rpartition would perform a left-partition when called with
a unicode argument. will backport.
This commit is contained in:
parent
aa5f873980
commit
3571fbfed7
3 changed files with 9 additions and 1 deletions
|
@ -1117,6 +1117,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'),
|
||||
|
@ -1132,6 +1135,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue