def dumps(obj): """ :param obj: object to be serialized :return: a string containing the serialized object """ from objpack.serializer import serialize return serialize(obj)
def test_pack_simple(): assert serialize(1234) == '1234' #assert objpack.dumps(u'abc') == '"abc"' assert serialize(b'abc') == 'b"abc"' assert serialize(b'\x00\x01\x02\x03') == r'b"\x00\x01\x02\x03"' pass