@bacpypes_debugging
def object_identifier_endec(v, x):
    """Pass the value to ObjectIdentifier, construct a tag from the hex string,
    and compare results of encode and decoding each other."""
    if _debug: object_identifier_endec._debug("object_identifier_endec %r %r", v, x)

    tag = object_identifier_tag(x)
    if _debug: object_identifier_endec._debug("    - tag: %r, %r", tag, tag.tagData)

    obj = ObjectIdentifier(v)
    if _debug: object_identifier_endec._debug("    - obj: %r, %r", obj, obj.value)

    assert object_identifier_encode(obj) == tag
    assert object_identifier_decode(tag) == obj
dataset/ETHPy150Open JoelBender/bacpypes/tests/test_primitive_data/test_object_identifier.py/object_identifier_endec/original