01a8518cc2e2f58f88612efad844b6085c149d51,tests/syft/core/io/location/specific_test.py,,test_binary_serialization,#,159

Before Change


    uid = UID(value=uuid.UUID(int=333779996850170035686993356951732753684))
    obj = SpecificLocation(id=uid)

    blob = (
        b"{"objType": "syft.core.io.location.specific.SpecificLocation", "content":"
        b" "{\\"id\\": {\\"value\\": \\"+xuwZ1u3TEm+zucAqwoVFA==\\"}}"}"
    )

    assert obj.binary() == blob
    assert obj.to_binary() == blob
    assert obj.serialize(to_binary=True) == blob

After Change


    obj = SpecificLocation(id=uid, name="Test")

    content = {"id": {"value": "+xuwZ1u3TEm+zucAqwoVFA=="}, "name": "Test"}
    main = {
        "objType": "syft.core.io.location.specific.SpecificLocation",
        "content": json.dumps(content),
    }
    blob = bytes(json.dumps(main), "utf-8")

    assert obj.binary() == blob
    assert obj.to_binary() == blob
    assert obj.serialize(to_binary=True) == blob
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenMined/PySyft
Commit Name: 01a8518cc2e2f58f88612efad844b6085c149d51
Time: 2020-08-19
Author: me@madhavajay.com
File Name: tests/syft/core/io/location/specific_test.py
Class Name:
Method Name: test_binary_serialization


Project Name: OpenMined/PySyft
Commit Name: 01a8518cc2e2f58f88612efad844b6085c149d51
Time: 2020-08-19
Author: me@madhavajay.com
File Name: tests/syft/core/io/location/specific_test.py
Class Name:
Method Name: test_binary_deserialization


Project Name: mozilla/bugbug
Commit Name: c7e3f97606320d2970a3ccc7617c63c053c90cd7
Time: 2020-06-01
Author: mcastelluccio@mozilla.com
File Name: tests/test_testselect.py
Class Name:
Method Name: test_reduce