ZTAPViewTimeline

View notes only relating to ZTAP.

python · Zero Trust Analytics Platform

Details

IDZTAPViewTimeline
Languagepython
From Version6.0.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagsztap

README

View notes only relating to ZTAP.

Script Data


Name Description
Script Type python3
Tags ztap
Cortex XSOAR Version 6.0.0

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

import json


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


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


def test_view_timeline(mocker):
    from ZTAPViewTimeline import view_timeline

    ztap_tags = ["ztap", "comment", "escalate"]
    entries = util_load_json("test_data/entries.json")
    output = view_timeline(entries, ztap_tags)

    mock_output = util_load_raw("test_data/output.md")
    assert output == mock_output