implement Packer.pack_extended_type also in the cython version of the code

This commit is contained in:
Antonio Cuni 2013-10-18 17:33:54 +02:00
parent afa28fb205
commit 5467515065
4 changed files with 69 additions and 1 deletions

View file

@ -6,7 +6,7 @@ def test_pack_extended_type():
def p(s):
packer = msgpack.Packer()
packer.pack_extended_type(0x42, s)
return packer._buffer.getvalue()
return packer.bytes()
assert p('A') == '\xd4\x42A' # fixext 1
assert p('AB') == '\xd5\x42AB' # fixext 2
assert p('ABCD') == '\xd6\x42ABCD' # fixext 4