summaryrefslogtreecommitdiff
path: root/test/test_extension.py
diff options
context:
space:
mode:
authorAntonio Cuni <anto.cuni@gmail.com>2013-10-18 14:38:52 +0200
committerAntonio Cuni <anto.cuni@gmail.com>2013-10-18 14:38:52 +0200
commit5529dfe59660f3c2fc5058e6fa42b24fe764a255 (patch)
treeebdd12a8a9d3118442b750949dd2876ef3d232b3 /test/test_extension.py
parentd61097511a1caa0e3bc5a70c1d2d92f448bd5025 (diff)
downloadmsgpack-python-5529dfe59660f3c2fc5058e6fa42b24fe764a255.tar.gz
kill some duplicate code from unpack/unpackb and move the logic to Unpacker.unpack_one. By doing this we no longer need to make the module-level pack/unpack parametric on the class, because they contain no logic at all
Diffstat (limited to 'test/test_extension.py')
-rw-r--r--test/test_extension.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/test_extension.py b/test/test_extension.py
index 45e6027..0a9c14f 100644
--- a/test/test_extension.py
+++ b/test/test_extension.py
@@ -18,7 +18,9 @@ def test_extension_type():
return obj
obj = [42, 'hello', array.array('d', [1.1, 2.2, 3.3])]
- s = msgpack.packb(obj, MyPacker)
- obj2 = msgpack.unpackb(s, MyUnpacker)
+ packer = MyPacker()
+ unpacker = MyUnpacker(None)
+ s = packer.pack(obj)
+ unpacker.feed(s)
+ obj2 = unpacker.unpack_one()
assert obj == obj2
-