def test_control_unpack_from_network_pdu(
    control_friend_offer_message: ControlMessage, net_key: NetworkKey
):
    _, _, unpacked_network_message = NetworkMessage.unpack(
        app_key,
        net_key,
        0x12345678,
        bytes.fromhex("68d4c826296d7979d7dbc0c9b4d43eebec129d20a620d01e"),
    )

    assert unpacked_network_message.message == control_friend_offer_message
def test_proxy_config_unpack_from_network_pdu(
    proxy_use_whitelist_message: ProxyConfigMessage,
):
    net_key_local = NetworkKey(bytes.fromhex("d1aafb2a1a3c281cbdb0e960edfad852"))
    _, _, unpacked_network_message = NetworkMessage.unpack(
        app_key,
        net_key_local,
        0x12345678,
        bytes.fromhex("10386bd60efbbb8b8c28512e792d3711f4b526"),
        proxy=True,
    )

    assert unpacked_network_message.message == proxy_use_whitelist_message
def test_application_unpack_from_network_pdu(
    health_current_status_message: AccessMessage,
    app_key: ApplicationKey,
    net_key: NetworkKey,
):
    _, _, unpacked_network_message = NetworkMessage.unpack(
        app_key,
        net_key,
        0x12345678,
        bytes.fromhex("6848cba437860e5673728a627fb938535508e21a6baf57"),
    )

    assert unpacked_network_message.message == health_current_status_message