diff options
author | Guido van Rossum <guido@python.org> | 2007-05-09 19:52:16 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-09 19:52:16 (GMT) |
commit | cd6ae68943e5bd219d0f32be346d1a730635aaa4 (patch) | |
tree | 404da2460ce3677ed0facc7aef878ce1859e5f49 /Lib | |
parent | 0925e419dfc5de666965dcd15ae08d045c7df36f (diff) | |
download | cpython-cd6ae68943e5bd219d0f32be346d1a730635aaa4.zip cpython-cd6ae68943e5bd219d0f32be346d1a730635aaa4.tar.gz cpython-cd6ae68943e5bd219d0f32be346d1a730635aaa4.tar.bz2 |
I don't know how come bytes.join() was a class method, but that's clearly
a mistake. It's not a regular (instance) method. b".".join([b"a", b"b"])
now returns b"a.b" -- it used to return b"ab"!
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_bytes.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 33a4b0d..9fdca7f 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -466,13 +466,14 @@ class BytesTest(unittest.TestCase): self.assertRaises(ValueError, bytes.fromhex, '12 \x00 34') def test_join(self): - self.assertEqual(bytes.join([]), bytes()) - self.assertEqual(bytes.join([bytes()]), bytes()) + self.assertEqual(b"".join([]), bytes()) + self.assertEqual(b"".join([bytes()]), bytes()) for part in [("abc",), ("a", "bc"), ("ab", "c"), ("a", "b", "c")]: lst = map(bytes, part) - self.assertEqual(bytes.join(lst), bytes("abc")) - self.assertEqual(bytes.join(tuple(lst)), bytes("abc")) - self.assertEqual(bytes.join(iter(lst)), bytes("abc")) + self.assertEqual(b"".join(lst), bytes("abc")) + self.assertEqual(b"".join(tuple(lst)), bytes("abc")) + self.assertEqual(b"".join(iter(lst)), bytes("abc")) + self.assertEqual(b".".join([b"ab", b"cd"]), b"ab.cd") # XXX more... def test_literal(self): |