DisplayHTML

Display HTML in the War Room.

python · Common Scripts

Details

IDDisplayHTML
Languagepython
From Version6.5.0
Docker Imagedemisto/python3:3.12.13.10404775

README

Displays HTML in the War Room.

Script Data


Name Description
Script Type python
Tags  

Inputs


Argument Name Description
html The HTML to display.
markAsNote Whether the entry should be marked as a note.
header Adds a header text to the output.

Outputs


There are no outputs for this script.

import demistomock as demisto
from CommonServerPython import *


def test_DisplayHTML(mocker):
    """
    Given:
        - The script args.
    When:
        - Running the DisplayHTML script.
    Then:
        - Validating the results after manipulating the given data.
    """
    from DisplayHTML import main

    mocker.patch.object(demisto, "args", return_value={"html": "html", "markAsNote": "True", "header": "header"})
    results_mock = mocker.patch.object(demisto, "results")
    main()
    results_mock.assert_called_once()
    results = results_mock.call_args[0][0]
    assert results == {"Contents": "<h1>header</h1></br>html", "ContentsFormat": "html", "Note": True, "Type": EntryType.NOTE}