File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ classifiers = [
1919 " Programming Language :: Python :: Implementation :: CPython" ,
2020 " Programming Language :: Python :: Implementation :: PyPy" ,
2121]
22+ dependencies = []
2223
2324[project .urls ]
2425Homepage = " https://msgpack.org/"
@@ -43,3 +44,9 @@ lint.select = [
4344 " I" , # isort
4445 # "UP", pyupgrade
4546]
47+
48+ [dependency-groups ]
49+ dev = [
50+ " cython>=3.2.5" ,
51+ " pytest>=9.0.3" ,
52+ ]
Original file line number Diff line number Diff line change 66
77def test_pack_ext_type ():
88 def p (s ):
9- packer = msgpack .Packer ()
9+ packer = msgpack .Packer (autoreset = False )
1010 packer .pack_ext_type (0x42 , s )
1111 return packer .bytes ()
1212
@@ -20,6 +20,15 @@ def p(s):
2020 assert p (b"A" * 0x00012345 ) == b"\xc9 \x00 \x01 \x23 \x45 \x42 " + b"A" * 0x00012345 # ext 32
2121
2222
23+ def test_pack_ext_type_autoreset ():
24+ packer = msgpack .Packer ()
25+
26+ assert packer .pack_ext_type (0x42 , b"A" ) == b"\xd4 \x42 A"
27+ assert packer .bytes () == b""
28+ assert packer .pack_ext_type (0x42 , b"ABC" ) == b"\xc7 \x03 \x42 ABC"
29+ assert packer .bytes () == b""
30+
31+
2332def test_unpack_ext_type ():
2433 def check (b , expected ):
2534 assert msgpack .unpackb (b ) == expected
You can’t perform that action at this time.
0 commit comments