mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-11-01 01:50:54 +00:00
Add some test for timestamp (#403)
This commit is contained in:
parent
ff1f5f89d9
commit
9d79351e99
6 changed files with 40 additions and 35 deletions
|
|
@ -9,29 +9,24 @@ def check(src, should, use_list=0, raw=True):
|
|||
|
||||
|
||||
def testSimpleValue():
|
||||
check(b"\x93\xc0\xc2\xc3", (None, False, True,))
|
||||
check(b"\x93\xc0\xc2\xc3", (None, False, True))
|
||||
|
||||
|
||||
def testFixnum():
|
||||
check(b"\x92\x93\x00\x40\x7f\x93\xe0\xf0\xff", ((0, 64, 127,), (-32, -16, -1,),))
|
||||
check(b"\x92\x93\x00\x40\x7f\x93\xe0\xf0\xff", ((0, 64, 127), (-32, -16, -1)))
|
||||
|
||||
|
||||
def testFixArray():
|
||||
check(
|
||||
b"\x92\x90\x91\x91\xc0", ((), ((None,),),),
|
||||
)
|
||||
check(b"\x92\x90\x91\x91\xc0", ((), ((None,),)))
|
||||
|
||||
|
||||
def testFixRaw():
|
||||
check(
|
||||
b"\x94\xa0\xa1a\xa2bc\xa3def", (b"", b"a", b"bc", b"def",),
|
||||
)
|
||||
check(b"\x94\xa0\xa1a\xa2bc\xa3def", (b"", b"a", b"bc", b"def"))
|
||||
|
||||
|
||||
def testFixMap():
|
||||
check(
|
||||
b"\x82\xc2\x81\xc0\xc0\xc3\x81\xc0\x80",
|
||||
{False: {None: None}, True: {None: {}}},
|
||||
b"\x82\xc2\x81\xc0\xc0\xc3\x81\xc0\x80", {False: {None: None}, True: {None: {}}}
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -40,7 +35,7 @@ def testUnsignedInt():
|
|||
b"\x99\xcc\x00\xcc\x80\xcc\xff\xcd\x00\x00\xcd\x80\x00"
|
||||
b"\xcd\xff\xff\xce\x00\x00\x00\x00\xce\x80\x00\x00\x00"
|
||||
b"\xce\xff\xff\xff\xff",
|
||||
(0, 128, 255, 0, 32768, 65535, 0, 2147483648, 4294967295,),
|
||||
(0, 128, 255, 0, 32768, 65535, 0, 2147483648, 4294967295),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -49,7 +44,7 @@ def testSignedInt():
|
|||
b"\x99\xd0\x00\xd0\x80\xd0\xff\xd1\x00\x00\xd1\x80\x00"
|
||||
b"\xd1\xff\xff\xd2\x00\x00\x00\x00\xd2\x80\x00\x00\x00"
|
||||
b"\xd2\xff\xff\xff\xff",
|
||||
(0, -128, -1, 0, -32768, -1, 0, -2147483648, -1,),
|
||||
(0, -128, -1, 0, -32768, -1, 0, -2147483648, -1),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue