mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-11-01 01:50:54 +00:00
Support packing memoryview objects
This commit is contained in:
parent
8036cb4e0e
commit
31adc5a3c0
3 changed files with 33 additions and 2 deletions
12
test/test_memoryview.py
Normal file
12
test/test_memoryview.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
|
||||
from msgpack import packb, unpackb
|
||||
|
||||
|
||||
def test_pack_memoryview():
|
||||
data = bytearray(range(256))
|
||||
view = memoryview(data)
|
||||
unpacked = unpackb(packb(view))
|
||||
assert data == unpacked
|
||||
Loading…
Add table
Add a link
Reference in a new issue