File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 2
2
# coding: utf-8
3
3
import pytest
4
4
5
- from msgpack import packb , unpackb
5
+ from msgpack import packb , unpackb , Packer
6
6
7
7
8
8
def test_integer ():
@@ -16,11 +16,27 @@ def test_integer():
16
16
with pytest .raises (OverflowError ):
17
17
packb (x + 1 )
18
18
19
+
20
+ def test_array_header ():
21
+ packer = Packer ()
22
+ packer .pack_array_header (2 ** 32 - 1 )
23
+ with pytest .raises (ValueError ):
24
+ packer .pack_array_header (2 ** 32 )
25
+
26
+
27
+ def test_map_header ():
28
+ packer = Packer ()
29
+ packer .pack_map_header (2 ** 32 - 1 )
30
+ with pytest .raises (ValueError ):
31
+ packer .pack_array_header (2 ** 32 )
32
+
33
+
19
34
@pytest .mark .skipif (True , "Requires very large memory." )
20
35
def test_binary ():
21
36
x = b'x' * (2 ** 32 - 1 )
22
37
assert unpackb (packb (x )) == x
23
- x += b'y'
38
+ del x
39
+ x = b'x' * (2 ** 32 )
24
40
with pytest .raises (ValueError ):
25
41
packb (x )
26
42
You can’t perform that action at this time.
0 commit comments