diff options
-rw-r--r-- | Lib/test/test_bytes.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 30000bd..f844628 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -277,13 +277,6 @@ class BaseBytesTest(unittest.TestCase): self.assertEqual(self.type2test(b".").join([b"ab", b"cd"]), b"ab.cd") # XXX more... - def test_index(self): - b = self.type2test(b'parrot') - self.assertEqual(b.index('p'), 0) - self.assertEqual(b.index('rr'), 2) - self.assertEqual(b.index('t'), 5) - self.assertRaises(ValueError, lambda: b.index('w')) - def test_count(self): b = self.type2test(b'mississippi') self.assertEqual(b.count(b'i'), 4) @@ -369,6 +362,10 @@ class BaseBytesTest(unittest.TestCase): def test_split_string_error(self): self.assertRaises(TypeError, self.type2test(b'a b').split, ' ') + def test_split_unicodewhitespace(self): + b = self.type2test(b"\x09\x0A\x0B\x0C\x0D\x1C\x1D\x1E\x1F") + self.assertEqual(b.split(), [b'\x1c\x1d\x1e\x1f']) + def test_rsplit(self): b = self.type2test(b'mississippi') self.assertEqual(b.rsplit(b'i'), [b'm', b'ss', b'ss', b'pp', b'']) @@ -392,18 +389,18 @@ class BaseBytesTest(unittest.TestCase): def test_rsplit_unicodewhitespace(self): b = self.type2test(b"\x09\x0A\x0B\x0C\x0D\x1C\x1D\x1E\x1F") - self.assertEqual(b.split(), [b'\x1c\x1d\x1e\x1f']) self.assertEqual(b.rsplit(), [b'\x1c\x1d\x1e\x1f']) def test_partition(self): b = self.type2test(b'mississippi') self.assertEqual(b.partition(b'ss'), (b'mi', b'ss', b'issippi')) - self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi')) + self.assertEqual(b.partition(b'w'), (b'mississippi', b'', b'')) def test_rpartition(self): b = self.type2test(b'mississippi') self.assertEqual(b.rpartition(b'ss'), (b'missi', b'ss', b'ippi')) self.assertEqual(b.rpartition(b'i'), (b'mississipp', b'i', b'')) + self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi')) def test_pickling(self): for proto in range(pickle.HIGHEST_PROTOCOL + 1): |