summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-07-22 12:06:11 (GMT)
committerGeorg Brandl <georg@python.org>2009-07-22 12:06:11 (GMT)
commit069bcc3dd99be9d4a0ea2202377066c0a77de651 (patch)
treee72e0ee70a669ce9fd29441a752ce3ad2b8e0efb /Lib/test/test_builtin.py
parent3cc12f69421f14c4d919cc015b71259056b3bc60 (diff)
downloadcpython-069bcc3dd99be9d4a0ea2202377066c0a77de651.zip
cpython-069bcc3dd99be9d4a0ea2202377066c0a77de651.tar.gz
cpython-069bcc3dd99be9d4a0ea2202377066c0a77de651.tar.bz2
Merged revisions 74169 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ................ r74169 | georg.brandl | 2009-07-22 14:03:59 +0200 (Mi, 22 Jul 2009) | 9 lines 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 fdb0ea2..28af247 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):