summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_buffer.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index 6bdc34d28e..ac8e636ba4 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -21,6 +21,14 @@ class BufferTests(unittest.TestCase):
self.assertEqual(b[start:stop:step],
s[start:stop:step])
+ def test_newbuffer_interface(self):
+ # Test that the buffer object has the new buffer interface
+ # as used by the memoryview object
+ s = "".join(chr(c) for c in list(range(255, -1, -1)))
+ b = buffer(s)
+ m = memoryview(b) # Should not raise an exception
+ self.assertEqual(m.tobytes(), s)
+
def test_main():
with test_support.check_py3k_warnings(("buffer.. not supported",