예제 #1
0
def testSerializeNullElement(data):
    data = [None]
    s = serialize(data)
    assert "[000001:000004:null:]" == s
예제 #2
0
def testSerializeNestedList(data):
    sublist = []
    sublist.append("element")
    data.append(sublist)
    assert "[000001:000024:[000001:000007:element:]:]" == serialize(data)
예제 #3
0
def testTwoItemListSerialize(data):
    data.append("hello")
    data.append("world")
    assert "[000002:000005:hello:000005:world:]" == serialize(data)
예제 #4
0
def testOneItemListSerialize(data):
    data.append("hello")
    assert "[000001:000005:hello:]" == serialize(data)
예제 #5
0
def testNullListSerialize(data):
    assert "[000000:]" == serialize(data)
def check(data):
    serialized = serialize(data)
    deserialized = deserialize(serialized)
    assert data == deserialized