summaryrefslogtreecommitdiff
path: root/Lib/test/test_bytes.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-16 22:24:03 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-16 22:24:03 +0300
commit6b2c851445d9b2a9dbfffae03ffd378135b8d784 (patch)
tree8fd8b22f3cf32e92ba9e38487bd0132ff2fa2a9d /Lib/test/test_bytes.py
parent3e994ef2d72400b1ebf075377e9b346caaaa04c6 (diff)
parent6597397bcee1c0a7c0458d284f6fb68c49a84649 (diff)
downloadcpython-6b2c851445d9b2a9dbfffae03ffd378135b8d784.tar.gz
Issue #27039: Fixed bytearray.remove() for values greater than 127.
Based on patch by Joe Jevnik.
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r--Lib/test/test_bytes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 5309a97599..1cedd3a855 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -1177,6 +1177,13 @@ class ByteArrayTest(BaseBytesTest, unittest.TestCase):
b.remove(Indexable(ord('e')))
self.assertEqual(b, b'')
+ # test values outside of the ascii range: (0, 127)
+ c = bytearray([126, 127, 128, 129])
+ c.remove(127)
+ self.assertEqual(c, bytes([126, 128, 129]))
+ c.remove(129)
+ self.assertEqual(c, bytes([126, 128]))
+
def test_pop(self):
b = bytearray(b'world')
self.assertEqual(b.pop(), ord('d'))