import demistomock as demisto import pytest from pytest_mock import MockerFixture from ShowCampaignSenders import main INCIDENT_IDS = [{"id": "1"}, {"id": "2"}, {"id": "3"}] DEMISTO_RESULT = [ { "Contents": '[{"emailfrom": "example1@support.com"}, {"emailfrom": "example2@support.co"}, ' '{"emailfrom": "example1@support.com"}, {"emailfrom": "example1@support.com"},' '{"emailfrom": "example1@support.com"}, {"emailfrom": "example3@support.co"},' '{"emailfrom": "example2@support.co"}]', "Type": 3, } ] EXPECTED_TABLE = ( "|Email|Number Of Appearances|\n|---|---|\n| example1@support.com | 4 |\n| " "example2@support.co | 2 |\n| example3@support.co | 1 |\n" ) @pytest.mark.parametrize( "incidents_id, execute_command_result, expected_md_result", [ (INCIDENT_IDS, DEMISTO_RESULT, EXPECTED_TABLE), (INCIDENT_IDS, [{"Contents": "[]", "Type": 3}], "No incidents found."), (INCIDENT_IDS, [{"Contents": "[{}]", "Type": 3}], "No incident senders found."), ( [], [], ( "