Beispiel #1
0
def test_uid_default_serialization() -> None:
    """Tests that default UID serialization works as expected - to Protobuf"""

    uid = UID(value=uuid.UUID(int=333779996850170035686993356951732753684))
    blob = _serialize(obj=uid)
    _ = _deserialize(blob=blob)
    assert sy.serialize(uid) == blob
Beispiel #2
0
def test_uid_proto_deserialization() -> None:
    """Tests that proto UID deserialization works as expected"""

    uid = UID(value=uuid.UUID(int=333779996850170035686993356951732753684))
    blob = _serialize(obj=uid)

    obj = sy.deserialize(blob=blob, from_proto=True)
    assert obj == UID(value=uuid.UUID(int=333779996850170035686993356951732753684))
Beispiel #3
0
def test_uid_proto_serialization() -> None:
    """Tests that proto UID serialization works as expected"""

    uid = UID(value=uuid.UUID(int=333779996850170035686993356951732753684))

    blob = _serialize(obj=uid)

    assert sy.serialize(uid, to_proto=True) == blob
    assert sy.serialize(uid, to_proto=True) == blob
    assert sy.serialize(uid, to_proto=True) == blob