Ejemplo n.º 1
0
def dumps(obj):
    """
    :param obj: object to be serialized
    :return: a string containing the serialized object
    """
    from objpack.serializer import serialize
    return serialize(obj)
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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