summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-07-22 12:03:59 (GMT)
committerGeorg Brandl <georg@python.org>2009-07-22 12:03:59 (GMT)
commit953152f0640d7c99b9ffe03392a4c9ce590489cb (patch)
treefd4a8d794c249b3a96846d8427e8df0ca4bb0862 /Lib/test/test_builtin.py
parent2f19bb1447ace998a375c96708a34058c2b4ffff (diff)
downloadcpython-953152f0640d7c99b9ffe03392a4c9ce590489cb.zip
cpython-953152f0640d7c99b9ffe03392a4c9ce590489cb.tar.gz
cpython-953152f0640d7c99b9ffe03392a4c9ce590489cb.tar.bz2
Merged revisions 74167 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74167 | georg.brandl | 2009-07-22 13:57:15 +0200 (Mi, 22 Jul 2009) | 1 line Issue #6540: Fixed crash for bytearray.translate() with invalid parameters. ........
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r--Lib/test/test_builtin.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 28fd938..cac4555 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -1229,6 +1229,11 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(bin(-(2**65)), '-0b1' + '0' * 65)
self.assertEqual(bin(-(2**65-1)), '-0b' + '1' * 65)
+ def test_bytearray_translate(self):
+ x = bytearray(b"abc")
+ self.assertRaises(ValueError, x.translate, b"1", 1)
+ self.assertRaises(TypeError, x.translate, b"1"*256, 1)
+
class TestSorted(unittest.TestCase):
def test_basic(self):