DataminrPulseEPSSScore

This dynamic automation parses the EPSS Score of a CVE and presents it in the layout.

python · Dataminr Pulse

Details

IDDataminrPulseEPSSScore
Languagepython
From Version6.10.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagsdynamic-indicator-section

README

This dynamic automation parses the EPSS Score of a CVE and presents it in the layout.

Script Data


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

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

from CommonServerPython import *  # noqa: F401
from DataminrPulseEPSSScore import main, demisto


def test_main_with_valid_eppss_score_data(mocker):
    """
    Test the main function with valid epss score.
    """

    context = {
        "args": {"indicator": {"CustomFields": {"dataminrpulseepssscore": "7.1%"}}},
    }

    mocker.patch.object(demisto, "callingContext", context)

    mock_return = mocker.patch("DataminrPulseEPSSScore.return_results")

    main()

    assert mock_return.call_args.args[0].readable_output == "# <-:->**7.1%**"


def test_main_with_no_epss_score_data(mocker):
    """
    Test the main function with no epss score data.
    """
    context = {
        "args": {"indicator": {"CustomFields": {}}},
    }

    mocker.patch.object(demisto, "callingContext", context)

    mock_return = mocker.patch("DataminrPulseEPSSScore.return_results")

    main()

    assert mock_return.call_args.args[0].readable_output == "# <-:->**N/A**"