PrintErrorEntry

Prints an error entry with a given message.

python · Common Scripts

Details

IDPrintErrorEntry
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10404775

README

Prints an error entry with a given message.

Script Data


Name Description
Script Type python
Tags -
Cortex XSOAR Version 4.0.0+

Inputs


Argument Name Description
message The error message to be printed.

Outputs


There are no outputs for this script.

import demistomock as demisto
from CommonServerPython import *  # noqa: F401


def test_main(mocker):
    import PrintErrorEntry

    # test custom fields with short names
    mocker.patch.object(demisto, "args", return_value={"message": "this is error"})
    mocker.patch.object(demisto, "results")
    PrintErrorEntry.main()
    assert demisto.results.call_count == 1
    results = demisto.results.call_args[0][0]
    assert results["Contents"] == "this is error"
    assert results["Type"] == EntryType.ERROR