CortexXDRAdditionalAlertInformationWidget

This script retrieves additional original alert information from the context.

python · Cortex XDR by Palo Alto Networks

Details

IDCortexXDRAdditionalAlertInformationWidget
Languagepython
From Version6.0.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagsdynamic-section

README

This script retrieves additional original alert information from the context.

Script Data


Name Description
Script Type python3
Tags dynamic-section
Cortex XSOAR Version 6.0.0

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

import CortexXDRAdditionalAlertInformationWidget
import pytest
from CommonServerPython import *


def util_load_json(path):
    with open(path, encoding="utf-8") as f:
        return json.loads(f.read())


@pytest.mark.parametrize(
    "context_data, expected_result",
    [
        (util_load_json("test_data/context_data1.json"), util_load_json("test_data/expected_results1.json")),
        (util_load_json("test_data/context_data2.json"), util_load_json("test_data/expected_results2.json")),
    ],
)
def test_additional_info(mocker, context_data, expected_result):
    mocker.patch.object(demisto, "context", return_value=context_data)
    mocker.patch.object(
        CortexXDRAdditionalAlertInformationWidget, "indicators_value_to_clickable", side_effect=lambda x: {a: a for a in x}
    )
    results = CortexXDRAdditionalAlertInformationWidget.get_additonal_info()
    assert results == expected_result