summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAntonio Cuni <anto.cuni@gmail.com>2013-10-18 15:03:58 +0200
committerAntonio Cuni <anto.cuni@gmail.com>2013-10-18 15:03:58 +0200
commit522c4bfc7993c296b78df9c9c91aac5fd40ae8e0 (patch)
tree54e6e344b0ad2a4ff91ee19b24e90397c3a76ae8 /test
parent5529dfe59660f3c2fc5058e6fa42b24fe764a255 (diff)
downloadmsgpack-python-522c4bfc7993c296b78df9c9c91aac5fd40ae8e0.tar.gz
slightly change to API
Diffstat (limited to 'test')
-rw-r--r--test/test_extension.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_extension.py b/test/test_extension.py
index 0a9c14f..0b26f8e 100644
--- a/test/test_extension.py
+++ b/test/test_extension.py
@@ -3,15 +3,16 @@ import msgpack
def test_extension_type():
class MyPacker(msgpack.Packer):
- def handle_extended_type(self, obj):
+ def handle_unknown_type(self, obj):
if isinstance(obj, array.array):
fmt = "ext 32"
typecode = 123 # application specific typecode
data = obj.tostring()
- return fmt, typecode, data
+ self.pack_extended_type(fmt, typecode, data)
+ return True
class MyUnpacker(msgpack.Unpacker):
- def handle_extended_type(self, typecode, data):
+ def read_extended_type(self, typecode, data):
assert typecode == 123
obj = array.array('d')
obj.fromstring(data)