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