summaryrefslogtreecommitdiff
path: root/Lib/test/string_tests.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-01 20:05:08 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-01 20:05:08 +0000
commitafa0d58a2d55fa157482e2006028688db6553f90 (patch)
treeec5c92dab493ce55e8fcd2099428b5089387127e /Lib/test/string_tests.py
parent50b1c4920be53f5155fce046617bb700fd02574f (diff)
downloadcpython-git-afa0d58a2d55fa157482e2006028688db6553f90.tar.gz
Issue #3751: str.rpartition would perform a left-partition when called with
a unicode argument. Backport of r66119
Diffstat (limited to 'Lib/test/string_tests.py')
-rw-r--r--Lib/test/string_tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index 69a2225cb2..e56bc021bf 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -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