summaryrefslogtreecommitdiff
path: root/python/test3/test_buffer.py
diff options
context:
space:
mode:
authorINADA Naoki <songofacandy@gmail.com>2010-11-03 03:15:12 +0900
committerINADA Naoki <songofacandy@gmail.com>2010-11-03 03:15:12 +0900
commitd1b6e65dd8927698ced5a3111baa4e81834850bc (patch)
tree7db5653487e5fb24575cb1b98e065c4b34020250 /python/test3/test_buffer.py
parent4688252bd41082a0dd077b150b53834c0346cdb1 (diff)
downloadmsgpack-python-d1b6e65dd8927698ced5a3111baa4e81834850bc.tar.gz
python: Port some tests from 2 to 3.
Diffstat (limited to 'python/test3/test_buffer.py')
-rw-r--r--python/test3/test_buffer.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/test3/test_buffer.py b/python/test3/test_buffer.py
new file mode 100644
index 0000000..01310a0
--- /dev/null
+++ b/python/test3/test_buffer.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+# coding: utf-8
+
+from nose import main
+from nose.tools import *
+from msgpack import packb, unpackb
+
+def test_unpack_buffer():
+ from array import array
+ buf = array('b')
+ buf.fromstring(packb(('foo', 'bar')))
+ obj = unpackb(buf)
+ assert_equal((b'foo', b'bar'), obj)
+
+if __name__ == '__main__':
+ main()