summaryrefslogtreecommitdiffstats
path: root/Lib/test/test__xxinterpchannels.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test__xxinterpchannels.py')
-rw-r--r--Lib/test/test__xxinterpchannels.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test__xxinterpchannels.py b/Lib/test/test__xxinterpchannels.py
index 750cd99..cb69f73 100644
--- a/Lib/test/test__xxinterpchannels.py
+++ b/Lib/test/test__xxinterpchannels.py
@@ -703,6 +703,21 @@ class ChannelTests(TestBase):
channels.recv(cid2)
del cid2
+ def test_send_buffer(self):
+ buf = bytearray(b'spamspamspam')
+ cid = channels.create()
+ channels.send_buffer(cid, buf)
+ obj = channels.recv(cid)
+
+ self.assertIsNot(obj, buf)
+ self.assertIsInstance(obj, memoryview)
+ self.assertEqual(obj, buf)
+
+ buf[4:8] = b'eggs'
+ self.assertEqual(obj, buf)
+ obj[4:8] = b'ham.'
+ self.assertEqual(obj, buf)
+
def test_allowed_types(self):
cid = channels.create()
objects = [