summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_buffer.py
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-11-10 17:17:22 (GMT)
committerStefan Krah <skrah@bytereef.org>2015-11-10 17:17:22 (GMT)
commit0ce5b6e2688ddf342780b663a095b3e0c9f5cc72 (patch)
tree36f44f86940823483ac4aef497fe37058bcf35e7 /Lib/test/test_buffer.py
parente46e09d0f5fc5b47d508abc510d92be0aba95599 (diff)
downloadcpython-0ce5b6e2688ddf342780b663a095b3e0c9f5cc72.zip
cpython-0ce5b6e2688ddf342780b663a095b3e0c9f5cc72.tar.gz
cpython-0ce5b6e2688ddf342780b663a095b3e0c9f5cc72.tar.bz2
Iaaue #25598: Fix memory_hex from #9951 for non-contiguous buffers.
Diffstat (limited to 'Lib/test/test_buffer.py')
-rw-r--r--Lib/test/test_buffer.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index a653390..2eef9fc 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -841,6 +841,11 @@ class TestBufferProtocol(unittest.TestCase):
# test tobytes()
self.assertEqual(result.tobytes(), b)
+ # test hex()
+ m = memoryview(result)
+ h = "".join("%02x" % c for c in b)
+ self.assertEqual(m.hex(), h)
+
# lst := expected multi-dimensional logical representation
# flatten(lst) := elements in C-order
ff = fmt if fmt else 'B'