diff options
-rw-r--r-- | test/test_limits.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/test/test_limits.py b/test/test_limits.py index 74e48c1..2610e42 100644 --- a/test/test_limits.py +++ b/test/test_limits.py @@ -5,33 +5,32 @@ import pytest from msgpack import ( packb, unpackb, Packer, Unpacker, ExtType, - PackOverflowError, PackValueError, UnpackValueError, ) def test_integer(): x = -(2 ** 63) assert unpackb(packb(x)) == x - with pytest.raises(PackOverflowError): + with pytest.raises(OverflowError): packb(x-1) x = 2 ** 64 - 1 assert unpackb(packb(x)) == x - with pytest.raises(PackOverflowError): + with pytest.raises(OverflowError): packb(x+1) def test_array_header(): packer = Packer() packer.pack_array_header(2**32-1) - with pytest.raises(PackValueError): + with pytest.raises(ValueError): packer.pack_array_header(2**32) def test_map_header(): packer = Packer() packer.pack_map_header(2**32-1) - with pytest.raises(PackValueError): + with pytest.raises(ValueError): packer.pack_array_header(2**32) @@ -44,7 +43,7 @@ def test_max_str_len(): assert unpacker.unpack() == d unpacker = Unpacker(max_str_len=2, raw=False) - with pytest.raises(UnpackValueError): + with pytest.raises(ValueError): unpacker.feed(packed) unpacker.unpack() @@ -58,7 +57,7 @@ def test_max_bin_len(): assert unpacker.unpack() == d unpacker = Unpacker(max_bin_len=2) - with pytest.raises(UnpackValueError): + with pytest.raises(ValueError): unpacker.feed(packed) unpacker.unpack() @@ -72,7 +71,7 @@ def test_max_array_len(): assert unpacker.unpack() == d unpacker = Unpacker(max_array_len=2) - with pytest.raises(UnpackValueError): + with pytest.raises(ValueError): unpacker.feed(packed) unpacker.unpack() @@ -86,7 +85,7 @@ def test_max_map_len(): assert unpacker.unpack() == d unpacker = Unpacker(max_map_len=2) - with pytest.raises(UnpackValueError): + with pytest.raises(ValueError): unpacker.feed(packed) unpacker.unpack() @@ -100,7 +99,7 @@ def test_max_ext_len(): assert unpacker.unpack() == d unpacker = Unpacker(max_ext_len=2) - with pytest.raises(UnpackValueError): + with pytest.raises(ValueError): unpacker.feed(packed) unpacker.unpack() |