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