Пример #1
0
def test_string_serde() -> None:
    syft_string = String("Hello OpenMined")

    serialized = syft_string._object2proto()

    assert isinstance(serialized, String_PB)

    deserialized = String._proto2object(proto=serialized)

    assert isinstance(deserialized, String)
    assert deserialized.id == syft_string.id
Пример #2
0
def string_serde(data: str) -> None:
    syft_string = String(data)

    serialized = syft_string._object2proto()
    String._proto2object(proto=serialized)