mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-11-02 10:30:54 +00:00
Fix using deprecated api in tests.
This commit is contained in:
parent
4bff55db9f
commit
2122b46b84
5 changed files with 29 additions and 29 deletions
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
from nose import main
|
||||
from nose.tools import *
|
||||
from msgpack import packs, unpacks
|
||||
from msgpack import packb, unpackb
|
||||
|
||||
|
||||
def check(length, obj):
|
||||
v = packs(obj)
|
||||
v = packb(obj)
|
||||
assert_equal(len(v), length, "%r length should be %r but get %r" % (obj, length, len(v)))
|
||||
assert_equal(unpacks(v), obj)
|
||||
assert_equal(unpackb(v), obj)
|
||||
|
||||
def test_1():
|
||||
for o in [None, True, False, 0, 1, (1 << 6), (1 << 7) - 1, -1,
|
||||
|
|
@ -70,8 +70,8 @@ def test_array32():
|
|||
|
||||
|
||||
def match(obj, buf):
|
||||
assert_equal(packs(obj), buf)
|
||||
assert_equal(unpacks(buf), obj)
|
||||
assert_equal(packb(obj), buf)
|
||||
assert_equal(unpackb(buf), obj)
|
||||
|
||||
def test_match():
|
||||
cases = [
|
||||
|
|
@ -99,7 +99,7 @@ def test_match():
|
|||
match(v, p)
|
||||
|
||||
def test_unicode():
|
||||
assert_equal(b'foobar', unpacks(packs('foobar')))
|
||||
assert_equal(b'foobar', unpackb(packb('foobar')))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue