summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bytes.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-16 19:24:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-16 19:24:03 (GMT)
commit4b23494ded6c452d2b777938654a10b2ad5122aa (patch)
treee2c4246fce610ef83e0b188cda41f0508c2cd4ef /Lib/test/test_bytes.py
parentaa99b8e36594242d7ef2f61cd03a1dd35bd018c8 (diff)
parent7bf36dace8c3d3714dfe5175891612450cb82ce5 (diff)
downloadcpython-4b23494ded6c452d2b777938654a10b2ad5122aa.zip
cpython-4b23494ded6c452d2b777938654a10b2ad5122aa.tar.gz
cpython-4b23494ded6c452d2b777938654a10b2ad5122aa.tar.bz2
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 5309a97..1cedd3a 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'))